@Test
public void test_allowedActions() {

    assertThat(allowedActions(createMessage(MsgStateEnum.NEW)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.NEW)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.OK)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.OK)).contains(MessageActionType.RESTART),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.IN_QUEUE)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.IN_QUEUE)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.PROCESSING)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.PROCESSING)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.PARTLY_FAILED)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.FAILED)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.FAILED)).contains(MessageActionType.RESTART),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.WAITING)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.WAITING)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.WAITING_FOR_RES)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.WAITING_FOR_RES)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.POSTPONED)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.POSTPONED)).contains(MessageActionType.CANCEL),
            is(Boolean.TRUE));
    assertThat(allowedActions(createMessage(MsgStateEnum.CANCEL)), hasSize(1));
    assertThat(allowedActions(createMessage(MsgStateEnum.CANCEL)).contains(MessageActionType.RESTART),
            is(Boolean.TRUE));
}