messageChannelPartitionHandler = new MessageChannelPartitionHandler();
//mock
StepExecution masterStepExecution = mock(StepExecution.class);
StepExecutionSplitter stepExecutionSplitter = mock(StepExecutionSplitter.class);
MessagingTemplate operations = mock(MessagingTemplate.class);
Message message = mock(Message.class);
PollableChannel replyChannel = mock(PollableChannel.class);
//when
HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
when(message.getPayload()).thenReturn(Collections.emptyList());
when(operations.receive(replyChannel)).thenReturn(message);
//set
messageChannelPartitionHandler.setMessagingOperations(operations);
messageChannelPartitionHandler.setReplyChannel(replyChannel);