@SuppressWarnings("unchecked")
@Test
public void testGetDefinition() {
TilesApplicationContext applicationContext = createMock(TilesApplicationContext.class);
DefinitionDAO<Locale> dao = createMock(DefinitionDAO.class);
LocaleResolver localeResolver = createMock(LocaleResolver.class);
UnresolvingLocaleDefinitionsFactory factory = new UnresolvingLocaleDefinitionsFactory();
TilesRequestContext request = createMock(TilesRequestContext.class);
Definition definition = createMock(Definition.class);
Locale locale = Locale.ITALY;
expect(localeResolver.resolveLocale(request)).andReturn(locale);
expect(dao.getDefinition("myDefinition", locale)).andReturn(definition);
replay(applicationContext, dao, localeResolver, request, definition);
factory.setApplicationContext(applicationContext);
factory.setDefinitionDAO(dao);