@Test public void processWithInvalidStatusFailure() { TaskAssigningSolution solution = new TaskAssigningSolution(-1, new ArrayList<>(), new ArrayList<>()); runnableBase.process(solution); Assertions.assertThatThrownBy(() -> runnableBase.process(solution)) .hasMessage("SolutionProcessor process method can only be invoked when the status is STOPPED"); }
public void process(final TaskAssigningSolution solution) { checkNotNull("solution", solution); if (!status.compareAndSet(STOPPED, STARTING)) { throw new IllegalStateException("SolutionProcessor process method can only be invoked when the status is STOPPED"); } this.solution = solution; solutionResource.release(); }
SolutionProcessor extends RunnableBase { public void process(final TaskAssigningSolution solution) { checkNotNull("solution", solution); if (!status.compareAndSet(STOPPED, STARTING)) { throw new IllegalStateException("SolutionProcessor process method can only be invoked when the status is STOPPED"); } this.solution = solution; solutionResource.release(); } }
SolutionProcessor extends RunnableBase { public void process(final TaskAssigningSolution solution) { checkNotNull("solution", solution); if (!status.compareAndSet(STOPPED, STARTING)) { throw new IllegalStateException("SolutionProcessor process method can only be invoked when the status is STOPPED"); } this.solution = solution; solutionResource.release(); } SolutionProcessor(final TaskAssigningRuntimeDelegate delegate,
                             final Consumer<Result> resultConsumer,
                             final String targetUserId,
                             final int publishWindowSize); }
SolutionProcessor extends RunnableBase { public void process(final TaskAssigningSolution solution) { checkNotNull("solution", solution); if (!status.compareAndSet(STOPPED, STARTING)) { throw new IllegalStateException("SolutionProcessor process method can only be invoked when the status is STOPPED"); } this.solution = solution; solutionResource.release(); } SolutionProcessor(final TaskAssigningRuntimeDelegate delegate,
                             final Consumer<Result> resultConsumer,
                             final String targetUserId,
                             final int publishWindowSize); boolean isProcessing(); void process(final TaskAssigningSolution solution); @Override void destroy(); @Override void run(); }
SolutionProcessor extends RunnableBase { public void process(final TaskAssigningSolution solution) { checkNotNull("solution", solution); if (!status.compareAndSet(STOPPED, STARTING)) { throw new IllegalStateException("SolutionProcessor process method can only be invoked when the status is STOPPED"); } this.solution = solution; solutionResource.release(); } SolutionProcessor(final TaskAssigningRuntimeDelegate delegate,
                             final Consumer<Result> resultConsumer,
                             final String targetUserId,
                             final int publishWindowSize); boolean isProcessing(); void process(final TaskAssigningSolution solution); @Override void destroy(); @Override void run();  }