Source:
<code>void testEventStreamsDecoratedOnReadAndWrite() throws InterruptedException { ExecutorService customExecutor = Executors.newCachedThreadPool(); testSubject = DisruptorCommandBus.builder() .bufferSize(8) .producerType(ProducerType.SINGLE) .waitStrategy(new SleepingWaitStrategy()) .executor(customExecutor) .invokerThreadCount(2) .publisherThreadCount(3) .build(); testSubject.subscribe(StubCommand.class.getName(), stubHandler); SnapshotTriggerDefinition snapshotTriggerDefinition = mock(SnapshotTriggerDefinition.class); SnapshotTrigger snapshotTrigger = mock(SnapshotTrigger.class); when(snapshotTriggerDefinition.prepareTrigger(any())).thenReturn(snapshotTrigger); stubHandler.setRepository(testSubject.createRepository(eventStore, new GenericAggregateFactory<>( <START> AnnotatedAggregateMetaModelFactory <END> .inspectAggregate(StubAggregate.class)), snapshotTriggerDefinition)); CommandMessage<StubCommand> command = asCommandMessage(new StubCommand(aggregateIdentifier)); CommandCallback mockCallback = mock(CommandCallback.class); testSubject.dispatch(command, mockCallback); testSubject.dispatch(command); testSubject.stop(); assertFalse(customExecutor.awaitTermination(250, TimeUnit.MILLISECONDS)); customExecutor.shutdown(); assertTrue(customExecutor.awaitTermination(5, TimeUnit.SECONDS)); InOrder inOrder = inOrder(snapshotTrigger); inOrder.verify(snapshotTrigger).eventHandled(isA(DomainEventMessage.class)); inOrder.verify(snapshotTrigger).initializationFinished(); inOrder.verify(snapshotTrigger, times(2)).eventHandled(isA(DomainEventMessage.class)); }</code><technical_language>Is this change necessary? nice for test show API compatibility changed. GenericAggregateFactory overloaded method</technical_language>

Target:
void testEventStreamsDecoratedOnReadAndWrite() throws InterruptedException { ExecutorService customExecutor = Executors.newCachedThreadPool(); testSubject = DisruptorCommandBus.builder() .bufferSize(8) .producerType(ProducerType.SINGLE) .waitStrategy(new SleepingWaitStrategy()) .executor(customExecutor) .invokerThreadCount(2) .publisherThreadCount(3) .build(); testSubject.subscribe(StubCommand.class.getName(), stubHandler); SnapshotTriggerDefinition snapshotTriggerDefinition = mock(SnapshotTriggerDefinition.class); SnapshotTrigger snapshotTrigger = mock(SnapshotTrigger.class); when(snapshotTriggerDefinition.prepareTrigger(any())).thenReturn(snapshotTrigger); stubHandler.setRepository( testSubject.createRepository(eventStore, new GenericAggregateFactory<>(StubAggregate.class), snapshotTriggerDefinition)); CommandMessage<StubCommand> command = asCommandMessage(new StubCommand(aggregateIdentifier)); CommandCallback mockCallback = mock(CommandCallback.class); testSubject.dispatch(command, mockCallback); testSubject.dispatch(command); testSubject.stop(); assertFalse(customExecutor.awaitTermination(250, TimeUnit.MILLISECONDS)); customExecutor.shutdown(); assertTrue(customExecutor.awaitTermination(5, TimeUnit.SECONDS)); InOrder inOrder = inOrder(snapshotTrigger); inOrder.verify(snapshotTrigger).eventHandled(isA(DomainEventMessage.class)); inOrder.verify(snapshotTrigger).initializationFinished(); inOrder.verify(snapshotTrigger, times(2)).eventHandled(isA(DomainEventMessage.class)); }