@Test public void testSuccessfulValidationRecentSortCriteria() { GetGalleryItemsRequest currentRequest = new GetGalleryItemsRequest(RECENT_SORT_CRITERIA, "", 0, 1); ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principalMock); sut.validate(currentContext); }
@Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { GetGalleryItemsRequest currentRequest = (GetGalleryItemsRequest) inActionContext.getParams(); if (!currentRequest.getSortCriteria().equals(RECENT_SORT_CRITERIA) && !currentRequest.getSortCriteria().equals(POPULARITY_SORT_CRITERIA)) { throw new ValidationException("Invalid sort criteria for this action."); } }
GetGalleryItemsValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { GetGalleryItemsRequest currentRequest = (GetGalleryItemsRequest) inActionContext.getParams(); if (!currentRequest.getSortCriteria().equals(RECENT_SORT_CRITERIA) && !currentRequest.getSortCriteria().equals(POPULARITY_SORT_CRITERIA)) { throw new ValidationException("Invalid sort criteria for this action."); } } }
GetGalleryItemsValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { GetGalleryItemsRequest currentRequest = (GetGalleryItemsRequest) inActionContext.getParams(); if (!currentRequest.getSortCriteria().equals(RECENT_SORT_CRITERIA) && !currentRequest.getSortCriteria().equals(POPULARITY_SORT_CRITERIA)) { throw new ValidationException("Invalid sort criteria for this action."); } }  }
GetGalleryItemsValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { GetGalleryItemsRequest currentRequest = (GetGalleryItemsRequest) inActionContext.getParams(); if (!currentRequest.getSortCriteria().equals(RECENT_SORT_CRITERIA) && !currentRequest.getSortCriteria().equals(POPULARITY_SORT_CRITERIA)) { throw new ValidationException("Invalid sort criteria for this action."); } }  @Override void validate(final ServiceActionContext inActionContext); }
GetGalleryItemsValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { GetGalleryItemsRequest currentRequest = (GetGalleryItemsRequest) inActionContext.getParams(); if (!currentRequest.getSortCriteria().equals(RECENT_SORT_CRITERIA) && !currentRequest.getSortCriteria().equals(POPULARITY_SORT_CRITERIA)) { throw new ValidationException("Invalid sort criteria for this action."); } }  @Override void validate(final ServiceActionContext inActionContext);  }