*/
@SuppressWarnings("unchecked")
@Test
public void testGetDefinition() {
DefinitionDAO<Locale> dao = createMock(DefinitionDAO.class);
LocaleResolver localeResolver = createMock(LocaleResolver.class);
Request request = createMock(Request.class);
Attribute templateAttribute = Attribute.createTemplateAttribute("/mytemplate.jsp");
Definition definition = new Definition("myDefinition", null, null);
definition.setExtends("anotherDefinition");
Map<String, Attribute> attributes = new HashMap<String, Attribute>();
attributes.put("first", new Attribute("myValue"));
Definition anotherDefinition = new Definition("anotherDefinition", templateAttribute, attributes);
Locale locale = Locale.ITALY;
expect(localeResolver.resolveLocale(request)).andReturn(locale);
expect(dao.getDefinition("myDefinition", locale)).andReturn(definition);
expect(dao.getDefinition("anotherDefinition", locale)).andReturn(anotherDefinition);
LocaleDefinitionsFactory factory = new LocaleDefinitionsFactory();