@Test public void messagingTemplateMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("messagingTemplate must not be null"); // when TaskletStep step = new RemoteChunkingMasterStepBuilder<String, String>("step") .messagingTemplate(null) .build(); // then // expected exception }
@Test public void eitherOutputChannelOrMessagingTemplateMustBeProvided() { // given RemoteChunkingMasterStepBuilder<String, String> builder = new RemoteChunkingMasterStepBuilder<String, String>("step") .inputChannel(this.inputChannel) .outputChannel(new DirectChannel()) .messagingTemplate(new MessagingTemplate()); this.expectedException.expect(IllegalStateException.class); this.expectedException.expectMessage("You must specify either an outputChannel or a messagingTemplate but not both."); // when TaskletStep step = builder.build(); // then // expected exception }