From 0bda6da19f6e39bdbedbffe2157c9621b22b86bf Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 17 Nov 2026 16:12:42 +0100 Subject: [PATCH] Clear the cached curation tasks after CreateMissingIdentifiersIT The test leaves the plugin service with only its "test" task. A test that runs later in the same JVM then cannot resolve the configured tasks, so CurationIT (noop) and HealthReportIT (metadataqa) fail depending on the test order. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 7529871849dcc6f05621a50328b538090c612155) --- .../dspace/ctask/general/CreateMissingIdentifiersIT.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java index 5013f2cb6690..ccb2aff6142b 100644 --- a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java +++ b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java @@ -28,6 +28,7 @@ import org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; +import org.junit.After; import org.junit.Test; /** @@ -44,6 +45,13 @@ public class CreateMissingIdentifiersIT private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); + @After + public void clearCachedTasks() { + // The base class resets the config after each test, but the plugin service would still cache + // only the "test" task, so later tests could not resolve their curation tasks. + CoreServiceFactory.getInstance().getPluginService().clearNamedPluginClasses(); + } + @Test public void testPerform() throws IOException {