/** * Creates a {@link RemotePartitioningWorkerStepBuilder} and initializes its job * repository, job explorer, bean factory and transaction manager. * @param name the name of the step * @return a {@link RemotePartitioningWorkerStepBuilder} */ public RemotePartitioningWorkerStepBuilder get(String name) { return new RemotePartitioningWorkerStepBuilder(name) .repository(this.jobRepository) .jobExplorer(this.jobExplorer) .beanFactory(this.beanFactory) .transactionManager(this.transactionManager); }
@Test public void jobExplorerMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("jobExplorer must not be null"); // when new RemotePartitioningWorkerStepBuilder("step").jobExplorer(null); // then // expected exception }
@Test public void testMandatoryInputChannel() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("An InputChannel must be provided"); // when new RemotePartitioningWorkerStepBuilder("step").tasklet(this.tasklet); // then // expected exception }
@Test public void outputChannelMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("outputChannel must not be null"); // when new RemotePartitioningWorkerStepBuilder("step").outputChannel(null); // then // expected exception }
@Test public void inputChannelMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("inputChannel must not be null"); // when new RemotePartitioningWorkerStepBuilder("step").inputChannel(null); // then // expected exception }
@Test public void stepLocatorMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("stepLocator must not be null"); // when new RemotePartitioningWorkerStepBuilder("step").stepLocator(null); // then // expected exception }
@Test public void beanFactoryMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("beanFactory must not be null"); // when new RemotePartitioningWorkerStepBuilder("step").beanFactory(null); // then // expected exception }
@Test public void testMandatoryJobExplorer() { // given DirectChannel inputChannel = new DirectChannel(); this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("A JobExplorer must be provided"); // when new RemotePartitioningWorkerStepBuilder("step") .inputChannel(inputChannel) .tasklet(this.tasklet); // then // expected exception }