@Test
public void testPrepareInboundCommand() {

    // Setup
    final InboundCommand command = mock(InboundCommand.class);
    ArgumentCaptor<InboundCommand> commandArgumentCaptor = ArgumentCaptor.forClass(InboundCommand.class);
    BubbleMessage message = mock(BubbleMessage.class);
    when(mockBubbleCache.getBubble(anyString())).thenReturn(Optional.of(message));
    when(command.buildMeta()).thenReturn(mockCommandMeta);
    when(mockCommandRepository.save(any(AbstractCommand.class))).thenReturn(command);
    // Apply set chnegs and get actual value
    doCallRealMethod().when(command).setStatus(InboundCommand.Status.PREPARED);
    doCallRealMethod().when(command).getStatus();
    // Run the test
    commandOrchestratorImplUnderTest.prepare(command);
    // Verify the results
    verify(mockPublisher).publishEvent(any(InboundCommandStarted.class));
    Assert.assertEquals(command.getStatus(), InboundCommand.Status.PREPARED);
    verify(mockPublisher).publishEvent(any(InboundCommandPrepared.class));
}