@Test public void testValidateValid() { sut.validate(new AsyncActionContext(new CreateNotificationsRequest(RequestType.FOLLOW_PERSON, 0))); }
@Override public void validate(final ActionContext inActionContext) throws ValidationException { CreateNotificationsRequest currentRequest = (CreateNotificationsRequest) inActionContext.getParams(); NotificationTranslator translator = translators.get(currentRequest.getType()); if (translator == null) { throw new ValidationException("Invalid notification type: " + currentRequest.getType()); } }
CreateNotificationsValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { CreateNotificationsRequest currentRequest = (CreateNotificationsRequest) inActionContext.getParams(); NotificationTranslator translator = translators.get(currentRequest.getType()); if (translator == null) { throw new ValidationException("Invalid notification type: " + currentRequest.getType()); } } }
CreateNotificationsValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { CreateNotificationsRequest currentRequest = (CreateNotificationsRequest) inActionContext.getParams(); NotificationTranslator translator = translators.get(currentRequest.getType()); if (translator == null) { throw new ValidationException("Invalid notification type: " + currentRequest.getType()); } } CreateNotificationsValidation(final Map<RequestType, NotificationTranslator> inTranslators); }
CreateNotificationsValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { CreateNotificationsRequest currentRequest = (CreateNotificationsRequest) inActionContext.getParams(); NotificationTranslator translator = translators.get(currentRequest.getType()); if (translator == null) { throw new ValidationException("Invalid notification type: " + currentRequest.getType()); } } CreateNotificationsValidation(final Map<RequestType, NotificationTranslator> inTranslators); @Override void validate(final ActionContext inActionContext); }
CreateNotificationsValidation implements ValidationStrategy<ActionContext> { @Override public void validate(final ActionContext inActionContext) throws ValidationException { CreateNotificationsRequest currentRequest = (CreateNotificationsRequest) inActionContext.getParams(); NotificationTranslator translator = translators.get(currentRequest.getType()); if (translator == null) { throw new ValidationException("Invalid notification type: " + currentRequest.getType()); } } CreateNotificationsValidation(final Map<RequestType, NotificationTranslator> inTranslators); @Override void validate(final ActionContext inActionContext);  }