ProjectDbsetRelationService { public ValidatorChain validatePermision(LoginUser user, ProjectDbsetRelation projectDbsetRelation, Errors errors) throws SQLException { return validatePermision(user.getId(), projectDbsetRelation.getProjectId(), errors); }  ValidatorChain validatePermision(LoginUser user, ProjectDbsetRelation projectDbsetRelation, Errors errors); boolean isNotExistByName(ProjectDbsetRelation projectDbsetRelation);  }
@Test public void validatePermisionTest() throws SQLException { LoginUser user = LoginUser.builder().id(1L).build(); ProjectDbsetRelation projectDbsetRelation = ProjectDbsetRelation.builder().dbsetId(1L).build(); Errors errors = new BeanPropertyBindingResult(projectDbsetRelation, "projectDbsetRelation", true, 256); Assert.assertTrue(projectDbsetRelationService.validatePermision(user, projectDbsetRelation, errors).validate().isValid()); }