test_class.declarator: modules
test_class.modifier: private
test_class.original_string: private List<SagaModule> modules;
test_class.type: List<SagaModule>
test_class.var_name: modules
test_class.file: saga-lib/src/test/java/com/codebullets/sagalib/processing/invocation/ModulesInvokerTest.java
test_class.identifier: ModulesInvokerTest
test_case.body: @Test
      public void start_startErrorOnSecondModule_doNotStartOrFinishedThird() {
          // given
          CurrentExecutionContext context = mock(CurrentExecutionContext.class);
          NullPointerException ex = new NullPointerException();
          doThrow(ex).when(modules.get(1)).onStart(context);
  
          // when
          try {
              ModulesInvoker.start(context, modules);
          } catch (Exception e) {
              // is expected, module start() is exception neutral
          }
  
          // then
          verify(modules.get(2), never()).onStart(context);
          verify(modules.get(2), never()).onFinished(context);
      }
test_case.class_method_signature: ModulesInvokerTest.start_startErrorOnSecondModule_doNotStartOrFinishedThird()
test_case.full_signature: @Test public void start_startErrorOnSecondModule_doNotStartOrFinishedThird()
test_case.identifier: start_startErrorOnSecondModule_doNotStartOrFinishedThird
test_case.invocations: mock onStart when doThrow get start onStart verify get never onFinished verify get never
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void start_startErrorOnSecondModule_doNotStartOrFinishedThird()
focal_class.declarator: LOG = LoggerFactory.getLogger(ModulesInvoker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(ModulesInvoker.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: finishers
focal_class.modifier: private final
focal_class.original_string: private final List<Supplier<Optional<Exception>>> finishers;
focal_class.type: List<Supplier<Optional<Exception>>>
focal_class.var_name: finishers
focal_class.declarator: errorHandlers
focal_class.modifier: private final
focal_class.original_string: private final List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers;
focal_class.type: List<BiFunction<Object, Throwable, Optional<Exception>>>
focal_class.var_name: errorHandlers
focal_class.file: saga-lib/src/main/java/com/codebullets/sagalib/processing/invocation/ModulesInvoker.java
focal_class.identifier: ModulesInvoker
focal_class.class_method_signature: ModulesInvoker.ModulesInvoker(
              final List<Supplier<Optional<Exception>>> finishers,
              final List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers)
focal_class.full_signature: private  ModulesInvoker(
              final List<Supplier<Optional<Exception>>> finishers,
              final List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers)
focal_class.identifier: ModulesInvoker
focal_class.modifiers: private
focal_class.parameters: (
              final List<Supplier<Optional<Exception>>> finishers,
              final List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers)
focal_class.signature:  ModulesInvoker(
              final List<Supplier<Optional<Exception>>> finishers,
              final List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers)
focal_class.class_method_signature: ModulesInvoker.start(final ExecutionContext context, final Iterable<SagaModule> modules)
focal_class.full_signature: static StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules)
focal_class.identifier: start
focal_class.modifiers: static
focal_class.parameters: (final ExecutionContext context, final Iterable<SagaModule> modules)
focal_class.return: StartResult
focal_class.signature: StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules)
focal_class.class_method_signature: ModulesInvoker.finish()
focal_class.full_signature:  Collection<Exception> finish()
focal_class.identifier: finish
focal_class.parameters: ()
focal_class.return: Collection<Exception>
focal_class.signature: Collection<Exception> finish()
focal_class.class_method_signature: ModulesInvoker.error(final Object message, final Throwable error)
focal_class.full_signature: public Collection<Exception> error(final Object message, final Throwable error)
focal_class.identifier: error
focal_class.modifiers: public
focal_class.parameters: (final Object message, final Throwable error)
focal_class.return: Collection<Exception>
focal_class.signature: Collection<Exception> error(final Object message, final Throwable error)
focal_class.class_method_signature: ModulesInvoker.createFinisher(final SagaModule module, final ExecutionContext context)
focal_class.full_signature: private static Supplier<Optional<Exception>> createFinisher(final SagaModule module, final ExecutionContext context)
focal_class.identifier: createFinisher
focal_class.modifiers: private static
focal_class.parameters: (final SagaModule module, final ExecutionContext context)
focal_class.return: Supplier<Optional<Exception>>
focal_class.signature: Supplier<Optional<Exception>> createFinisher(final SagaModule module, final ExecutionContext context)
focal_class.class_method_signature: ModulesInvoker.createErrorHandler(final SagaModule module, final ExecutionContext context)
focal_class.full_signature: private static BiFunction<Object, Throwable, Optional<Exception>> createErrorHandler(final SagaModule module, final ExecutionContext context)
focal_class.identifier: createErrorHandler
focal_class.modifiers: private static
focal_class.parameters: (final SagaModule module, final ExecutionContext context)
focal_class.return: BiFunction<Object, Throwable, Optional<Exception>>
focal_class.signature: BiFunction<Object, Throwable, Optional<Exception>> createErrorHandler(final SagaModule module, final ExecutionContext context)
focal_class.class_method_signature: ModulesInvoker.tryExecute(final Runnable runnable, final SagaModule module)
focal_class.full_signature: private static Optional<Exception> tryExecute(final Runnable runnable, final SagaModule module)
focal_class.identifier: tryExecute
focal_class.modifiers: private static
focal_class.parameters: (final Runnable runnable, final SagaModule module)
focal_class.return: Optional<Exception>
focal_class.signature: Optional<Exception> tryExecute(final Runnable runnable, final SagaModule module)
focal_method.body: static StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules) {
          Exception possibleStartException = null;
          List<Supplier<Optional<Exception>>> finishers = new ArrayList<>();
          List<BiFunction<Object, Throwable, Optional<Exception>>> errorHandlers = new ArrayList<>();
  
          try {
              for (final SagaModule module : modules) {
                  finishers.add(createFinisher(module, context));
                  errorHandlers.add(createErrorHandler(module, context));
  
                  module.onStart(context);
              }
          } catch (Exception ex) {
              possibleStartException = ex;
          }
  
          return new StartResult(possibleStartException, new ModulesInvoker(finishers, errorHandlers));
      }
focal_method.class_method_signature: ModulesInvoker.start(final ExecutionContext context, final Iterable<SagaModule> modules)
focal_method.full_signature: static StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules)
focal_method.identifier: start
focal_method.invocations: add createFinisher add createErrorHandler onStart
focal_method.modifiers: static
focal_method.parameters: (final ExecutionContext context, final Iterable<SagaModule> modules)
focal_method.return: StartResult
focal_method.signature: StartResult start(final ExecutionContext context, final Iterable<SagaModule> modules)