@Test
public void test_processorOrder() {

    when(finalMessageProcessor.getOrder()).thenReturn(0);
    when(additionalMessageProcessor.getOrder()).thenReturn(1); // should be second
    createAndSaveMessages(1, (message, order) -> {
        switch (order) {
            case 1:
                message.setState(MsgStateEnum.OK);
                message.setLastUpdateTimestamp(Instant.now().minusSeconds(okSaveTimeInSec + 1));
                break;
        }
    });
    // call tested service
    messagesProcessingService.processMessages();
    InOrder inOrder = inOrder(finalMessageProcessor, additionalMessageProcessor);
    inOrder.verify(finalMessageProcessor, times(1)).processMessage(any(Message.class));
    inOrder.verify(additionalMessageProcessor, times(1)).processMessage(any(Message.class));
}