@Test
public void partitionedJob() {
String moduleGroupName = "partitionedJob";
int moduleIndex = 0;
Module module = Mockito.mock(Module.class);
when(module.getType()).thenReturn(ModuleType.job);
Properties properties = new Properties();
when(module.getProperties()).thenReturn(properties);
when(module.getDescriptor()).thenReturn(
new ModuleDescriptor.Builder().setGroup(moduleGroupName).setIndex(moduleIndex).setModuleDefinition(
ModuleDefinitions.dummy("testjob", ModuleType.job)).build());
MessageChannel stepsOut = new DirectChannel();
when(module.getComponent("stepExecutionRequests.output", MessageChannel.class)).thenReturn(stepsOut);
PollableChannel stepResultsIn = new QueueChannel();
when(module.getComponent("stepExecutionReplies.input", MessageChannel.class)).thenReturn(stepResultsIn);
PollableChannel stepsIn = new QueueChannel();
when(module.getComponent("stepExecutionRequests.input", MessageChannel.class)).thenReturn(stepsIn);
MessageChannel stepResultsOut = new DirectChannel();
when(module.getComponent("stepExecutionReplies.output", MessageChannel.class)).thenReturn(stepResultsOut);
jobPartitionerPlugin.preProcessModule(module);
jobPartitionerPlugin.postProcessModule(module);
checkBusBound(messageBus);
stepsOut.send(new GenericMessage<String>("foo"));
Message<?> stepExecutionRequest = stepsIn.receive(10000);