@Test public void testMissingIdParameterReturnsInvalidMessage() { ValidationMessage message = validator.validateParameters(new HashMap<String, String>()); assertSame(message,validator.INVALID_ID_MESSAGE); }
@Override public ValidationMessage validateParameters(Map<String, String> requestParameters) { String id = requestParameters.get(idParameter); if(id == null || id.length()==0) return INVALID_ID_MESSAGE; else return VALID_ID_MESSAGE; }
FrequentlyRelatedContentRequestParameterValidator implements SearchRequestParameterValidator { @Override public ValidationMessage validateParameters(Map<String, String> requestParameters) { String id = requestParameters.get(idParameter); if(id == null || id.length()==0) return INVALID_ID_MESSAGE; else return VALID_ID_MESSAGE; } }
FrequentlyRelatedContentRequestParameterValidator implements SearchRequestParameterValidator { @Override public ValidationMessage validateParameters(Map<String, String> requestParameters) { String id = requestParameters.get(idParameter); if(id == null || id.length()==0) return INVALID_ID_MESSAGE; else return VALID_ID_MESSAGE; } FrequentlyRelatedContentRequestParameterValidator(Configuration configuration); }
FrequentlyRelatedContentRequestParameterValidator implements SearchRequestParameterValidator { @Override public ValidationMessage validateParameters(Map<String, String> requestParameters) { String id = requestParameters.get(idParameter); if(id == null || id.length()==0) return INVALID_ID_MESSAGE; else return VALID_ID_MESSAGE; } FrequentlyRelatedContentRequestParameterValidator(Configuration configuration); @Override ValidationMessage validateParameters(Map<String, String> requestParameters); }
FrequentlyRelatedContentRequestParameterValidator implements SearchRequestParameterValidator { @Override public ValidationMessage validateParameters(Map<String, String> requestParameters) { String id = requestParameters.get(idParameter); if(id == null || id.length()==0) return INVALID_ID_MESSAGE; else return VALID_ID_MESSAGE; } FrequentlyRelatedContentRequestParameterValidator(Configuration configuration); @Override ValidationMessage validateParameters(Map<String, String> requestParameters); final ValidationMessage VALID_ID_MESSAGE; final ValidationMessage INVALID_ID_MESSAGE; }