@Test
public void testRetreiveWhenCommandExistInDbAndBubbleMessage() throws IOException {

    // Setup
    final String eventId = "1234";
    final TestData someData = new TestData("test user", "20");
    final AbstractCommand command = mock(AbstractCommand.class);
    String payload = "{\"name\":\"test user\", \"age\":\"20\"}";
    BubbleMessage message = mock(BubbleMessage.class);
    when(command.getPayload()).thenReturn(payload);
    when(mockBubbleCache.getBubble(eventId)).thenReturn(Optional.of(message));
    when(mockCommandRepository.findOne(anyString())).thenReturn(command);
    when(mockMapper.readValue(payload, TestData.class)).thenReturn(someData);
    // Run the test
    final Optional<TestData> result = commandOrchestratorImplUnderTest.retreive(eventId, TestData.class);
    // Verify the results
    assertEquals( Optional.of(someData), result);
}