/** * Creates a {@link RemoteChunkingMasterStepBuilder} and initializes its job * repository and transaction manager. * * @param name the name of the step * @param <I> type of input items * @param <O> type of output items * @return a {@link RemoteChunkingMasterStepBuilder} */ public <I, O> RemoteChunkingMasterStepBuilder<I, O> get(String name) { return new RemoteChunkingMasterStepBuilder<I, O>(name) .repository(this.jobRepository) .transactionManager(this.transactionManager); }
@Test public void testMasterStepCreation() { // when TaskletStep taskletStep = new RemoteChunkingMasterStepBuilder<String, String>("step") .reader(this.itemReader) .repository(this.jobRepository) .transactionManager(this.transactionManager) .inputChannel(this.inputChannel) .outputChannel(this.outputChannel) .build(); // then Assert.assertNotNull(taskletStep); }
.processor(itemProcessor) .repository(this.jobRepository) .transactionManager(this.transactionManager) .transactionAttribute(transactionAttribute) .inputChannel(this.inputChannel)
@Test public void testUnsupportedOperationExceptionWhenSpecifyingAnItemWriter() { // given this.expectedException.expect(UnsupportedOperationException.class); this.expectedException.expectMessage("When configuring a master " + "step for remote chunking, the item writer will be automatically " + "set to an instance of ChunkMessageChannelItemWriter. " + "The item writer must not be provided in this case."); // when TaskletStep step = new RemoteChunkingMasterStepBuilder<String, String>("step") .reader(this.itemReader) .writer(items -> { }) .repository(this.jobRepository) .transactionManager(this.transactionManager) .inputChannel(this.inputChannel) .outputChannel(this.outputChannel) .build(); // then // expected exception }