@SuppressWarnings("unchecked")
@Test
public void testGetDefinition() {

    DefinitionDAO<Locale> dao = createMock(DefinitionDAO.class);
    LocaleResolver localeResolver = createMock(LocaleResolver.class);
    UnresolvingLocaleDefinitionsFactory factory = new UnresolvingLocaleDefinitionsFactory();
    Request request = createMock(Request.class);
    Definition definition = createMock(Definition.class);
    Locale locale = Locale.ITALY;
    expect(localeResolver.resolveLocale(request)).andReturn(locale);
    expect(dao.getDefinition("myDefinition", locale)).andReturn(definition);
    replay(dao, localeResolver, request, definition);
    factory.setDefinitionDAO(dao);
    factory.setLocaleResolver(localeResolver);
    assertEquals(definition, factory.getDefinition("myDefinition", request));
    verify(dao, localeResolver, request, definition);
}