@Test public void testValidateForCreate_WithValidNewUser_ValidationSucceeds() throws Exception { this.validator.validateForCreate(this.newUserDto); }
@Override public void validateForCreate(UserDto dto) throws Exception { validate(dto); OSCEntityManager<User> emgr = new OSCEntityManager<User>(User.class, this.em, this.txBroadcastUtil); if (emgr.isExisting("loginName", dto.getLoginName())) { throw new VmidcBrokerValidationException("User Login Name: " + dto.getLoginName() + " already exists."); } }
UserDtoValidator implements DtoValidator<UserDto, User> { @Override public void validateForCreate(UserDto dto) throws Exception { validate(dto); OSCEntityManager<User> emgr = new OSCEntityManager<User>(User.class, this.em, this.txBroadcastUtil); if (emgr.isExisting("loginName", dto.getLoginName())) { throw new VmidcBrokerValidationException("User Login Name: " + dto.getLoginName() + " already exists."); } } }
UserDtoValidator implements DtoValidator<UserDto, User> { @Override public void validateForCreate(UserDto dto) throws Exception { validate(dto); OSCEntityManager<User> emgr = new OSCEntityManager<User>(User.class, this.em, this.txBroadcastUtil); if (emgr.isExisting("loginName", dto.getLoginName())) { throw new VmidcBrokerValidationException("User Login Name: " + dto.getLoginName() + " already exists."); } } UserDtoValidator(EntityManager em, TransactionalBroadcastUtil txBroadcastUtil); }
UserDtoValidator implements DtoValidator<UserDto, User> { @Override public void validateForCreate(UserDto dto) throws Exception { validate(dto); OSCEntityManager<User> emgr = new OSCEntityManager<User>(User.class, this.em, this.txBroadcastUtil); if (emgr.isExisting("loginName", dto.getLoginName())) { throw new VmidcBrokerValidationException("User Login Name: " + dto.getLoginName() + " already exists."); } } UserDtoValidator(EntityManager em, TransactionalBroadcastUtil txBroadcastUtil); @Override void validateForCreate(UserDto dto); @Override User validateForUpdate(UserDto dto); static void checkForNullFields(UserDto dto); static void checkFieldLength(UserDto dto); }
UserDtoValidator implements DtoValidator<UserDto, User> { @Override public void validateForCreate(UserDto dto) throws Exception { validate(dto); OSCEntityManager<User> emgr = new OSCEntityManager<User>(User.class, this.em, this.txBroadcastUtil); if (emgr.isExisting("loginName", dto.getLoginName())) { throw new VmidcBrokerValidationException("User Login Name: " + dto.getLoginName() + " already exists."); } } UserDtoValidator(EntityManager em, TransactionalBroadcastUtil txBroadcastUtil); @Override void validateForCreate(UserDto dto); @Override User validateForUpdate(UserDto dto); static void checkForNullFields(UserDto dto); static void checkFieldLength(UserDto dto);  }