@Test public void messagingTemplateMustNotBeNull() { // given this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("messagingTemplate must not be null"); // when new RemotePartitioningMasterStepBuilder("step").messagingTemplate(null); // then // expected exception }
@Test public void eitherOutputChannelOrMessagingTemplateMustBeProvided() { // given RemotePartitioningMasterStepBuilder builder = new RemotePartitioningMasterStepBuilder("step") .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 Step step = builder.build(); // then // expected exception }