From 138d5607a676d00bfe1b1bb5a33341bed981c59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Mu=C3=B1oz?= Date: Wed, 17 Jan 2024 17:42:19 +0100 Subject: [PATCH] [JBPM-10217] Authentication fails on Oracle WLS in TaskAssigning (#3010) IntegrationTest --- .../taskassigning/planning/SolverHandler.java | 2 +- .../planning/SolverHandlerConfig.java | 10 ++++++- .../planning/TaskAssigningConstants.java | 5 ++++ ...gningPlanningKieServerExtensionHelper.java | 26 +++++++++++++++++-- ...ingPlanningKieServerExtensionMessages.java | 2 ++ .../planning/TaskAssigningServiceConfig.java | 6 +++-- .../planning/SolverHandlerConfigTest.java | 9 ++++++- .../planning/SolverHandlerTest.java | 13 +++++----- ...gPlanningKieServerExtensionHelperTest.java | 10 +++++++ .../TaskAssigningServiceConfigTest.java | 5 +++- .../pom.xml | 5 ++++ 11 files changed, 79 insertions(+), 14 deletions(-) diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandler.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandler.java index e591f94342..a5fbb69a9a 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandler.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandler.java @@ -102,7 +102,7 @@ public void start() { solutionProcessor = createSolutionProcessor(delegate, this::onSolutionProcessed, config.getTargetUserId(), config.getPublishWindowSize()); executorService.execute(solverExecutor); //is started/stopped on demand by the SolutionSynchronizer. - executorService.execute(solutionSynchronizer); + executorService.schedule(solutionSynchronizer, config.getInitDelay(), TimeUnit.MILLISECONDS); executorService.execute(solutionProcessor); solutionSynchronizer.initSolverExecutor(); } diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfig.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfig.java index 2ebb859152..772fdd277f 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfig.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfig.java @@ -30,6 +30,7 @@ public class SolverHandlerConfig { private Duration usersSyncInterval; private Duration waitForImprovedSolutionDuration; private Duration improveSolutionOnBackgroundDuration; + private long initDelay; public SolverHandlerConfig(String targetUserId, int publishWindowSize, @@ -37,7 +38,8 @@ public SolverHandlerConfig(String targetUserId, Duration syncQueriesShift, Duration usersSyncInterval, Duration waitForImprovedSolutionDuration, - Duration improveSolutionOnBackgroundDuration) { + Duration improveSolutionOnBackgroundDuration, + long initDelay) { if (targetUserId == null || targetUserId.isEmpty()) { throw new IllegalArgumentException("A non empty targetUserId is expected."); } @@ -47,6 +49,7 @@ public SolverHandlerConfig(String targetUserId, checkGreaterOrEqualTo("usersSyncInterval", usersSyncInterval, Duration.ZERO); checkGreaterOrEqualTo("waitForImprovedSolutionDuration", waitForImprovedSolutionDuration, Duration.ZERO); checkGreaterOrEqualTo("improveSolutionOnBackgroundDuration", improveSolutionOnBackgroundDuration, Duration.ZERO); + checkGreaterOrEqualTo("initDelay", initDelay, 0L); this.targetUserId = targetUserId; this.publishWindowSize = publishWindowSize; this.syncInterval = syncInterval; @@ -54,6 +57,7 @@ public SolverHandlerConfig(String targetUserId, this.usersSyncInterval = usersSyncInterval; this.waitForImprovedSolutionDuration = waitForImprovedSolutionDuration; this.improveSolutionOnBackgroundDuration = improveSolutionOnBackgroundDuration; + this.initDelay = initDelay; } public String getTargetUserId() { @@ -83,4 +87,8 @@ public Duration getWaitForImprovedSolutionDuration() { public Duration getImproveSolutionOnBackgroundDuration() { return improveSolutionOnBackgroundDuration; } + + public long getInitDelay() { + return initDelay; + } } diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningConstants.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningConstants.java index a3222b672f..d293ac5120 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningConstants.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningConstants.java @@ -117,6 +117,11 @@ private TaskAssigningConstants() { */ public static final String TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION = "org.kie.server.taskAssigning.improveSolutionOnBackgroundDuration"; + /** + * Property for configuring the initial delay (in milliseconds) to start the extension. + */ + public static final String TASK_ASSIGNING_INIT_DELAY = "org.kie.server.taskAssigning.initDelay"; + /** * Property for configuring the resource with the solver configuration. */ diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionHelper.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionHelper.java index 748a22c3ec..f3eda39f1d 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionHelper.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionHelper.java @@ -29,10 +29,12 @@ import static org.kie.server.services.taskassigning.planning.TaskAssigningConstants.TASK_ASSIGNING_SYNC_QUERIES_SHIFT; import static org.kie.server.services.taskassigning.planning.TaskAssigningConstants.TASK_ASSIGNING_USERS_SYNC_INTERVAL; import static org.kie.server.services.taskassigning.planning.TaskAssigningConstants.TASK_ASSIGNING_WAIT_FOR_IMPROVED_SOLUTION_DURATION; +import static org.kie.server.services.taskassigning.planning.TaskAssigningConstants.TASK_ASSIGNING_INIT_DELAY; import static org.kie.server.services.taskassigning.planning.TaskAssigningPlanningKieServerExtensionMessages.PARAMETER_MUST_HAVE_A_GREATER_OR_EQUAL_TO_ZERO_DURATION_VALUE_ERROR; import static org.kie.server.services.taskassigning.planning.TaskAssigningPlanningKieServerExtensionMessages.PARAMETER_MUST_HAVE_A_GREATER_THAN_ZERO_DURATION_VALUE_ERROR; import static org.kie.server.services.taskassigning.planning.TaskAssigningPlanningKieServerExtensionMessages.PARAMETER_MUST_HAVE_A_GREATER_THAN_ZERO_INTEGER_VALUE_ERROR; import static org.kie.server.services.taskassigning.planning.TaskAssigningPlanningKieServerExtensionMessages.PARAMETER_MUST_HAVE_A_NON_EMPTY_STRING_VALUE_ERROR; +import static org.kie.server.services.taskassigning.planning.TaskAssigningPlanningKieServerExtensionMessages.PARAMETER_MUST_BE_ZERO_OR_GREATER_THAN_ZERO_LONG_VALUE_ERROR; public class TaskAssigningPlanningKieServerExtensionHelper { @@ -42,9 +44,10 @@ public class TaskAssigningPlanningKieServerExtensionHelper { static final String DEFAULT_USERS_SYNC_INTERVAL = "PT2H"; static final String DEFAULT_WAIT_FOR_IMPROVED_SOLUTION_DURATION = "PT0S"; static final String DEFAULT_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION = "PT1M"; + static final long DEFAULT_INIT_DELAY = 0L; private static final String CAUSE = ", cause :"; - + private TaskAssigningPlanningKieServerExtensionHelper() { } @@ -56,6 +59,7 @@ public static TaskAssigningServiceConfig readAndValidateTaskAssigningServiceConf Duration usersSyncInterval; Duration waitForImprovedSolutionDuration; Duration improveSolutionOnBackgroundDuration; + long initDelay; targetUserId = trimToNull(System.getProperty(TASK_ASSIGNING_PROCESS_RUNTIME_TARGET_USER)); if (isNull(targetUserId)) { @@ -86,8 +90,12 @@ public static TaskAssigningServiceConfig readAndValidateTaskAssigningServiceConf String.format(PARAMETER_MUST_HAVE_A_GREATER_OR_EQUAL_TO_ZERO_DURATION_VALUE_ERROR, TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION)); + initDelay = parseAndValidateEqualsOrGreaterThanZeroLong(System.getProperty(TASK_ASSIGNING_INIT_DELAY, Long.toString(DEFAULT_INIT_DELAY)), + String.format(PARAMETER_MUST_BE_ZERO_OR_GREATER_THAN_ZERO_LONG_VALUE_ERROR, + TASK_ASSIGNING_INIT_DELAY)); + return new TaskAssigningServiceConfig(targetUserId, publishWindowSize, syncInterval, syncQueriesShift, - usersSyncInterval, waitForImprovedSolutionDuration, improveSolutionOnBackgroundDuration); + usersSyncInterval, waitForImprovedSolutionDuration, improveSolutionOnBackgroundDuration, initDelay); } private static Duration parseAndValidateGreaterThanZeroDuration(String value, String validationErrorMessage) throws TaskAssigningValidationException { @@ -125,4 +133,18 @@ private static int parseAndValidateGreaterThanZeroInteger(String value, String v } return result; } + + private static long parseAndValidateEqualsOrGreaterThanZeroLong(String value, String validationErrorMessage) throws TaskAssigningValidationException { + long result; + try { + result = Long.parseLong(value); + } catch (NumberFormatException e) { + String msg = validationErrorMessage + CAUSE + e.toString(); + throw new TaskAssigningValidationException(msg); + } + if (result < 0) { + throw new TaskAssigningValidationException(validationErrorMessage); + } + return result; + } } diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionMessages.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionMessages.java index be4d6f2ea0..cba89759cc 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionMessages.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningPlanningKieServerExtensionMessages.java @@ -81,6 +81,8 @@ private TaskAssigningPlanningKieServerExtensionMessages() { static final String PARAMETER_MUST_HAVE_A_GREATER_OR_EQUAL_TO_ZERO_DURATION_VALUE_ERROR = "Parameter %s must be configured with a greater or equal to zero time duration"; + static final String PARAMETER_MUST_BE_ZERO_OR_GREATER_THAN_ZERO_LONG_VALUE_ERROR = "Parameter %s must be configured with a greater or equal to zero long value"; + static String addExtensionMessagePrefix(String msg) { return String.format(PLANNER_EXTENSION_MESSAGE_PREFIX, msg); } diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfig.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfig.java index c091c5e2c6..adcc67d2db 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfig.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/main/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfig.java @@ -28,14 +28,16 @@ public TaskAssigningServiceConfig(String targetUserId, Duration syncQueriesShift, Duration usersSyncInterval, Duration waitForImprovedSolutionDuration, - Duration improveSolutionOnBackgroundDuration) { + Duration improveSolutionOnBackgroundDuration, + long initDelay) { solverHandlerConfig = new SolverHandlerConfig(targetUserId, publishWindowSize, syncInterval, syncQueriesShift, usersSyncInterval, waitForImprovedSolutionDuration, - improveSolutionOnBackgroundDuration); + improveSolutionOnBackgroundDuration, + initDelay); } public SolverHandlerConfig getSolverHandlerConfig() { diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfigTest.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfigTest.java index c0bc37ccb8..c3e5393cc3 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfigTest.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerConfigTest.java @@ -32,6 +32,7 @@ public class SolverHandlerConfigTest { public static final Duration USERS_SYNC_INTERVAL = Duration.parse("PT3H"); public static final Duration WAIT_FOR_IMPROVED_SOLUTION_DURATION = Duration.parse("PT1S"); public static final Duration IMPROVE_SOLUTION_ON_BACKGROUND_DURATION = Duration.parse("PT1M"); + public static final long INIT_DELAY = 10000; protected SolverHandlerConfig config; @@ -43,7 +44,8 @@ public void setUp() { SYNC_QUERIES_SHIFT, USERS_SYNC_INTERVAL, WAIT_FOR_IMPROVED_SOLUTION_DURATION, - IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); + IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, + INIT_DELAY); } @Test @@ -80,4 +82,9 @@ public void getWaitForImprovedSolutionDuration() { public void getImproveSolutionOnBackgroundDuration() { assertThat(config.getImproveSolutionOnBackgroundDuration()).isEqualTo(IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); } + + @Test + public void getInitDelay() { + assertThat(config.getInitDelay()).isEqualTo(INIT_DELAY); + } } diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerTest.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerTest.java index 4ef9200cda..b51ee78542 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerTest.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/SolverHandlerTest.java @@ -1,5 +1,4 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,6 +55,7 @@ import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.TARGET_USER; import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.USERS_SYNC_INTERVAL; import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.WAIT_FOR_IMPROVED_SOLUTION_DURATION; +import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.INIT_DELAY; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyLong; @@ -129,7 +129,8 @@ public void setUp() { handlerConfig = spy(new SolverHandlerConfig(TARGET_USER, PUBLISH_WINDOW_SIZE, SYNC_INTERVAL, SYNC_QUERIES_SHIFT, USERS_SYNC_INTERVAL, WAIT_FOR_IMPROVED_SOLUTION_DURATION, - IMPROVE_SOLUTION_ON_BACKGROUND_DURATION)); + IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, + INIT_DELAY)); previousQueryTime = LocalDateTime.now(); nextQueryTime = previousQueryTime.plusMinutes(2); this.handler = spy(new SolverHandler(solverDef, registry, delegate, userSystemService, executorService, handlerConfig)); @@ -152,7 +153,7 @@ public void hasImproveSolutionOnBackgroundDuration() { public void start() { prepareStart(); verify(executorService).execute(solverExecutor); - verify(executorService).execute(solutionSynchronizer); + verify(executorService).schedule(solutionSynchronizer, INIT_DELAY, TimeUnit.MILLISECONDS); verify(executorService).execute(solutionProcessor); verify(solutionSynchronizer).initSolverExecutor(); } @@ -217,7 +218,7 @@ public void onBestSolutionChangeWithWaitForImprovedSolutionDurationWhenChangeSet SolverHandlerContext context = contextCaptor.getValue(); context.setProcessedChangeSet(context.getCurrentChangeSetId()); listenerCaptor.getValue().bestSolutionChanged(event); - verify(executorService, never()).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + verify(executorService).schedule(solutionSynchronizer, INIT_DELAY, TimeUnit.MILLISECONDS); } private void prepareOnBestSolutionChangeWithWaitForImprovedSolutionDuration(Duration waitForImprovedSolutionDuration) { @@ -252,7 +253,7 @@ public void onBestSolutionChangeWithWaitForImprovedSolutionDurationZero() { context.setCurrentChangeSetId(changeSet); listenerCaptor.getValue().bestSolutionChanged(event); verify(solutionProcessor).process(event.getNewBestSolution()); - verify(executorService, never()).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + verify(executorService).schedule(solutionSynchronizer, INIT_DELAY, TimeUnit.MILLISECONDS); assertTrue(context.isProcessedChangeSet(changeSet)); } @@ -413,7 +414,7 @@ private void onBestSolutionChangeEventNotProcessed(BestSolutionChangedEvent produceFailingCases() { data.add(new Object[]{TASK_ASSIGNING_WAIT_FOR_IMPROVED_SOLUTION_DURATION, NON_PARSEABLE}); data.add(new Object[]{TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, NEGATIVE_DURATION.toString()}); data.add(new Object[]{TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, NON_PARSEABLE}); + data.add(new Object[]{TASK_ASSIGNING_INIT_DELAY, Long.toString(NEGATIVE_LONG)}); + data.add(new Object[]{TASK_ASSIGNING_INIT_DELAY, NON_PARSEABLE}); return data; } @@ -96,6 +102,7 @@ public void readAndValidateTaskAssigningServiceConfigFull() throws TaskAssigning assertThat(handlerConfig.getUsersSyncInterval()).isEqualTo(USERS_SYNC_INTERVAL); assertThat(handlerConfig.getWaitForImprovedSolutionDuration()).isEqualTo(WAIT_FOR_IMPROVED_SOLUTION_DURATION); assertThat(handlerConfig.getImproveSolutionOnBackgroundDuration()).isEqualTo(IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); + assertThat(handlerConfig.getInitDelay()).isEqualTo(INIT_DELAY); } @Test @@ -110,6 +117,7 @@ public void readAndValidateTaskAssigningServiceConfigDefaults() throws TaskAssig assertThat(handlerConfig.getUsersSyncInterval()).isEqualTo(Duration.parse(DEFAULT_USERS_SYNC_INTERVAL)); assertThat(handlerConfig.getWaitForImprovedSolutionDuration()).isEqualTo(Duration.parse(DEFAULT_WAIT_FOR_IMPROVED_SOLUTION_DURATION)); assertThat(handlerConfig.getImproveSolutionOnBackgroundDuration()).isEqualTo(Duration.parse(DEFAULT_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION)); + assertThat(handlerConfig.getInitDelay()).isEqualTo(DEFAULT_INIT_DELAY); } @Test @@ -137,6 +145,7 @@ public static void prepareTaskAssigningServiceProperties() { System.setProperty(TASK_ASSIGNING_USERS_SYNC_INTERVAL, USERS_SYNC_INTERVAL.toString()); System.setProperty(TASK_ASSIGNING_WAIT_FOR_IMPROVED_SOLUTION_DURATION, WAIT_FOR_IMPROVED_SOLUTION_DURATION.toString()); System.setProperty(TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, IMPROVE_SOLUTION_ON_BACKGROUND_DURATION.toString()); + System.setProperty(TASK_ASSIGNING_INIT_DELAY, Long.toString(INIT_DELAY)); } public static void clearTaskAssigningServiceProperties() { @@ -147,5 +156,6 @@ public static void clearTaskAssigningServiceProperties() { System.clearProperty(TASK_ASSIGNING_USERS_SYNC_INTERVAL); System.clearProperty(TASK_ASSIGNING_WAIT_FOR_IMPROVED_SOLUTION_DURATION); System.clearProperty(TASK_ASSIGNING_IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); + System.clearProperty(TASK_ASSIGNING_INIT_DELAY); } } \ No newline at end of file diff --git a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfigTest.java b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfigTest.java index 6eb5cb47d9..e13738ef86 100644 --- a/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfigTest.java +++ b/kie-server-parent/kie-server-services/kie-server-services-task-assigning/kie-server-services-task-assigning-planning/src/test/java/org/kie/server/services/taskassigning/planning/TaskAssigningServiceConfigTest.java @@ -26,6 +26,7 @@ import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.TARGET_USER; import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.USERS_SYNC_INTERVAL; import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.WAIT_FOR_IMPROVED_SOLUTION_DURATION; +import static org.kie.server.services.taskassigning.planning.SolverHandlerConfigTest.INIT_DELAY; public class TaskAssigningServiceConfigTest { @@ -37,7 +38,8 @@ public void getSolverHandlerConfig() { SYNC_QUERIES_SHIFT, USERS_SYNC_INTERVAL, WAIT_FOR_IMPROVED_SOLUTION_DURATION, - IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); + IMPROVE_SOLUTION_ON_BACKGROUND_DURATION, + INIT_DELAY); SolverHandlerConfig handlerConfig = serviceConfig.getSolverHandlerConfig(); assertThat(handlerConfig).isNotNull(); @@ -48,5 +50,6 @@ public void getSolverHandlerConfig() { assertThat(handlerConfig.getUsersSyncInterval()).isEqualTo(USERS_SYNC_INTERVAL); assertThat(handlerConfig.getWaitForImprovedSolutionDuration()).isEqualTo(WAIT_FOR_IMPROVED_SOLUTION_DURATION); assertThat(handlerConfig.getImproveSolutionOnBackgroundDuration()).isEqualTo(IMPROVE_SOLUTION_ON_BACKGROUND_DURATION); + assertThat(handlerConfig.getInitDelay()).isEqualTo(INIT_DELAY); } } diff --git a/kie-server-parent/kie-server-tests/kie-server-integ-tests-task-assigning/pom.xml b/kie-server-parent/kie-server-tests/kie-server-integ-tests-task-assigning/pom.xml index 518ebdb847..cba9768be0 100644 --- a/kie-server-parent/kie-server-tests/kie-server-integ-tests-task-assigning/pom.xml +++ b/kie-server-parent/kie-server-tests/kie-server-integ-tests-task-assigning/pom.xml @@ -14,6 +14,7 @@ org.kie.server.itests.taskassigning + 0 @@ -141,6 +142,7 @@ usetheforce123@ yoda> PT1S + ${org.kie.server.taskAssigning.initDelay} SimpleUserSystemService ${project.build.testOutputDirectory}/roles.properties @@ -242,6 +244,9 @@ oracle-wls-12 + + 20000 + websphere9