@Test
public void test_state_ignoring() {

    // none of the messages should be processed
    createAndSaveMessages(5, (message, order) -> {
        switch (order) {
            case 1:
                message.setState(MsgStateEnum.NEW);
                break;
            case 2:
                message.setState(MsgStateEnum.IN_QUEUE);
                break;
            case 3:
                message.setState(MsgStateEnum.PROCESSING);
                break;
            case 4:
                message.setState(MsgStateEnum.WAITING);
                break;
            case 5:
                message.setState(MsgStateEnum.PARTLY_FAILED);
                break;
        }
    });
    messagesProcessingService.processMessages();
}