use of org.eclipse.dataspaceconnector.spi.command.CommandQueue in project DataSpaceConnector by eclipse-dataspaceconnector.
the class AbstractContractNegotiationIntegrationTest method setUp.
/**
* Prepares the test setup
*/
@BeforeEach
void setUp() {
// Create contract validation service mock, method mocking has to be done in test methods
validationService = mock(ContractValidationService.class);
// Create a monitor that logs to the console
Monitor monitor = new ConsoleMonitor();
// Create CommandQueue mock
CommandQueue<ContractNegotiationCommand> queue = (CommandQueue<ContractNegotiationCommand>) mock(CommandQueue.class);
when(queue.dequeue(anyInt())).thenReturn(new ArrayList<>());
// Create CommandRunner mock
CommandRunner<ContractNegotiationCommand> runner = (CommandRunner<ContractNegotiationCommand>) mock(CommandRunner.class);
providerStore = new InMemoryContractNegotiationStore();
consumerStore = new InMemoryContractNegotiationStore();
providerManager = ProviderContractNegotiationManagerImpl.Builder.newInstance().dispatcherRegistry(new FakeProviderDispatcherRegistry()).monitor(monitor).validationService(validationService).waitStrategy(() -> 1000).commandQueue(queue).commandRunner(runner).observable(providerObservable).store(providerStore).policyStore(policyStore).build();
consumerManager = ConsumerContractNegotiationManagerImpl.Builder.newInstance().dispatcherRegistry(new FakeConsumerDispatcherRegistry()).monitor(monitor).validationService(validationService).waitStrategy(() -> 1000).commandQueue(queue).commandRunner(runner).observable(consumerObservable).store(consumerStore).policyStore(policyStore).build();
countDownLatch = new CountDownLatch(2);
}
Aggregations