RemoteChunkingWorkerBuilder { @SuppressWarnings({"unchecked", "rawtypes"}) public IntegrationFlow build() { Assert.notNull(this.itemWriter, "An ItemWriter must be provided"); Assert.notNull(this.inputChannel, "An InputChannel must be provided"); Assert.notNull(this.outputChannel, "An OutputChannel must be provided"); if(this.itemProcessor == null) { this.itemProcessor = new PassThroughItemProcessor(); } SimpleChunkProcessor<I, O> chunkProcessor = new SimpleChunkProcessor<>(this.itemProcessor, this.itemWriter); ChunkProcessorChunkHandler<I> chunkProcessorChunkHandler = new ChunkProcessorChunkHandler<>(); chunkProcessorChunkHandler.setChunkProcessor(chunkProcessor); return IntegrationFlows .from(this.inputChannel) .handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME) .channel(this.outputChannel) .get(); }  RemoteChunkingWorkerBuilder<I, O> itemProcessor(ItemProcessor<I, O> itemProcessor); RemoteChunkingWorkerBuilder<I, O> itemWriter(ItemWriter<O> itemWriter); RemoteChunkingWorkerBuilder<I, O> inputChannel(MessageChannel inputChannel); RemoteChunkingWorkerBuilder<I, O> outputChannel(MessageChannel outputChannel); @SuppressWarnings({"unchecked", "rawtypes"}) IntegrationFlow build();  }
@Test public void testMandatoryItemWriter() { RemoteChunkingWorkerBuilder<String, String> builder = new RemoteChunkingWorkerBuilder<>(); this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("An ItemWriter must be provided"); builder.build(); }