@Test
public void testGetMessageTypeEntity()
{

    // Create and persist a message type entity.
    MessageTypeEntity messageTypeEntity = messageTypeDaoTestHelper.createMessageTypeEntity(MESSAGE_TYPE);
    // Retrieve the message type entity and validate the result.
    assertEquals(messageTypeEntity, messageTypeDaoHelper.getMessageTypeEntity(MESSAGE_TYPE));
    // Test case insensitivity of the message type code.
    assertEquals(messageTypeEntity, messageTypeDaoHelper.getMessageTypeEntity(MESSAGE_TYPE.toUpperCase()));
    assertEquals(messageTypeEntity, messageTypeDaoHelper.getMessageTypeEntity(MESSAGE_TYPE.toLowerCase()));
    // Try to retrieve a non existing message type.
    try
    {
        messageTypeDaoHelper.getMessageTypeEntity(I_DO_NOT_EXIST);
        fail();
    }
    catch (ObjectNotFoundException e)
    {
        assertEquals(String.format("Message type with code \"%s\" doesn't exist.", I_DO_NOT_EXIST), e.getMessage());
    }
}