@Test(expected = ValidationException.class) public void testNullContextParams() { sut.validate(TestContextCreator.createPrincipalActionContext(null, null)); context.assertIsSatisfied(); }
public void validate(final ActionContext inActionContext) throws ValidationException { CommentDTO request = (CommentDTO) inActionContext.getParams(); if (request == null) { throw new ValidationException("A comment must be provided."); } if (StringUtils.isBlank(request.getBody())) { throw new ValidationException("Comment must contain body content."); } }
PostActivityCommentValidation implements ValidationStrategy<ActionContext> { public void validate(final ActionContext inActionContext) throws ValidationException { CommentDTO request = (CommentDTO) inActionContext.getParams(); if (request == null) { throw new ValidationException("A comment must be provided."); } if (StringUtils.isBlank(request.getBody())) { throw new ValidationException("Comment must contain body content."); } } }
PostActivityCommentValidation implements ValidationStrategy<ActionContext> { public void validate(final ActionContext inActionContext) throws ValidationException { CommentDTO request = (CommentDTO) inActionContext.getParams(); if (request == null) { throw new ValidationException("A comment must be provided."); } if (StringUtils.isBlank(request.getBody())) { throw new ValidationException("Comment must contain body content."); } }  }
PostActivityCommentValidation implements ValidationStrategy<ActionContext> { public void validate(final ActionContext inActionContext) throws ValidationException { CommentDTO request = (CommentDTO) inActionContext.getParams(); if (request == null) { throw new ValidationException("A comment must be provided."); } if (StringUtils.isBlank(request.getBody())) { throw new ValidationException("Comment must contain body content."); } }  void validate(final ActionContext inActionContext); }
PostActivityCommentValidation implements ValidationStrategy<ActionContext> { public void validate(final ActionContext inActionContext) throws ValidationException { CommentDTO request = (CommentDTO) inActionContext.getParams(); if (request == null) { throw new ValidationException("A comment must be provided."); } if (StringUtils.isBlank(request.getBody())) { throw new ValidationException("Comment must contain body content."); } }  void validate(final ActionContext inActionContext);  }