public void beaneditcontext_pushed_to_environment()
{
ComponentResources resources = mockComponentResources();
BeanModelSource source = mockBeanModelSource();
BeanModel model = mockBeanModel();
Environment env = mockEnvironment();
RegistrationData data = new RegistrationData();
Messages messages = mockMessages();
PropertyOverrides overrides = mockPropertyOverrides();
train_getBoundType(resources, "object", RegistrationData.class);
train_createEditModel(source, RegistrationData.class, messages, model);
train_getOverrideMessages(overrides, messages);
expect(model.newInstance()).andReturn(data);
expect(model.getBeanType()).andReturn(RegistrationData.class);
BeanEditContext ctxt = new BeanEditContext()
{
public Class<?> getBeanClass()
{
return RegistrationData.class;
}
public <T extends Annotation> T getAnnotation(Class<T> type)
{
return null;
}
};
expect(env.push(eq(BeanEditContext.class), contextEq())).andReturn(ctxt);
expect(env.push(eq(BeanValidationContext.class), isA(BeanValidationContext.class)))
.andReturn(null);
replay();
BeanEditor component = new BeanEditor();