public void test_Palette_Required()
{
ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
IRequestCycle cycle = newCycle();
FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
IMarkupWriter writer = newWriter();
JSONObject profile = new JSONObject();
Required required = new Required("message=Field {0} is required.");
Palette component = newInstance(Palette.class,
new Object[] {
"validatableFieldSupport", vfs,
"clientId", "pal", "displayName", "Pally"});
expect(context.getProfile()).andReturn(profile);
expect(context.formatValidationMessage(eq(required.getMessage()), eq(ValidationStrings.REQUIRED_FIELD),
aryEq(new Object[] { "Pally" }) )).andReturn("Pally is required.");
replay();
assert component.overrideValidator(required, cycle);