@Bean public IntegrationFlow workerIntegrationFlow() { return this.remoteChunkingWorkerBuilder .itemProcessor(itemProcessor()) .itemWriter(itemWriter()) .inputChannel(requests()) .outputChannel(replies()) .build(); }
@Test public void itemProcessorMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("itemProcessor must not be null"); // when IntegrationFlow integrationFlow = new RemoteChunkingWorkerBuilder<String, String>() .itemProcessor(null) .build(); // then // expected exception }
@Test public void testIntegrationFlowCreation() { // given DirectChannel inputChannel = new DirectChannel(); DirectChannel outputChannel = new DirectChannel(); RemoteChunkingWorkerBuilder<String, String> builder = new RemoteChunkingWorkerBuilder<String, String>() .itemProcessor(this.itemProcessor) .itemWriter(this.itemWriter) .inputChannel(inputChannel) .outputChannel(outputChannel); // when IntegrationFlow integrationFlow = builder.build(); // then Assert.assertNotNull(integrationFlow); }