@Test public void testValidateValid() { ValidationStrategy<ActionContext> sut = new DisableNotificationCategoryValidation(CATEGORIES); ActionContext ctx = TestContextCreator.createPrincipalActionContext("LIKE", null); sut.validate(ctx); }
@Override public void validate(final ActionContext inActionContext) throws ValidationException { String category = (String) inActionContext.getParams(); if (!categories.contains(category)) { throw new ValidationException("Invalid notification category: " + category); } }
DisableNotificationCategoryValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { String category = (String) inActionContext.getParams(); if (!categories.contains(category)) { throw new ValidationException("Invalid notification category: " + category); } } }
DisableNotificationCategoryValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { String category = (String) inActionContext.getParams(); if (!categories.contains(category)) { throw new ValidationException("Invalid notification category: " + category); } } DisableNotificationCategoryValidation(final Set<String> inCategories); }
DisableNotificationCategoryValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { String category = (String) inActionContext.getParams(); if (!categories.contains(category)) { throw new ValidationException("Invalid notification category: " + category); } } DisableNotificationCategoryValidation(final Set<String> inCategories); @Override void validate(final ActionContext inActionContext); }
DisableNotificationCategoryValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { String category = (String) inActionContext.getParams(); if (!categories.contains(category)) { throw new ValidationException("Invalid notification category: " + category); } } DisableNotificationCategoryValidation(final Set<String> inCategories); @Override void validate(final ActionContext inActionContext);  }