LocaleProcessor extends AbstractGameBootProcessor<LocaleMessage> { @Override protected void validate(LocaleMessage message) throws Exception { if (message == null) fail(getResponseContext(NO_MESSAGE), "No message"); if (isEmpty(message.getLanguageCode())) { fail(getResponseContext(LANG_CODE_MISSING, message.getSystemId()), "Missing lang code"); } if (message.getSystemId() == null) { fail(getResponseContext(NO_SYSTEM_ID, message.getSystemId()), "Missing system id"); } }  @Override String getType(); static final String PROFILE; }
@Test public void testValidation() throws Exception { validationFailExpected(null, "Null message"); LocaleMessage msg = new LocaleMessage(); msg.setSystemId(SYSTEM_ID_KEY); validationFailExpected(msg, "No lang or country codes"); msg.setCountryCode(FRANCE_CODE); validationFailExpected(msg, "No lang code"); msg.setLanguageCode(FRENCH_CODE); processor.validate(msg); }