@Test
public void testOnCommandStartedWhenDecodedRegistredAndCommandExistInDb() {

    // Setup
    final InboundCommandStarted commandStarted = mock(InboundCommandStarted.class);
    final CommandMeta meta = mock(CommandMeta.class);
    final BaseDecoder decoder = mock(BaseDecoder.class);
    final BaseTransactionEvent event = mock(BaseTransactionEvent.class);
    final InboundCommand command = mock(InboundCommand.class);
    when(mockDecoderRegistry.containsKey(anyString())).thenReturn(true);
    when(commandStarted.getMeta()).thenReturn(meta);
    when(mockDecoderRegistry.get(anyString())).thenReturn(decoder);
    when(decoder.decode(meta)).thenReturn(event);
    when(mockCommandRepository.findInboundommandOpt(anyString())).thenReturn(Optional.of(command));
    // Run the test
    languageTranslatorImplUnderTest.onCommandStarted(commandStarted);
    // Verify the results
    verify(mockBubbleCache, atLeastOnce()).addBubble(anyString(), any(BubbleMessage.class));
    verify(mockPublisher).publishEvent(event);
    verify(command).changeStatusToCompleted();
}