@Test public void testValidateforCreate_UsingValidNewImage_Suceeds() throws Exception { ApplianceSoftwareVersionDto dto = newApplianceSoftwareVersionDto(); this.validator.validateForCreate(dto); }
@Override public void validateForCreate(ApplianceSoftwareVersionDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); ApplianceSoftwareVersion asv = ApplianceSoftwareVersionEntityMgr.findByImageUrl(this.em, dto.getImageUrl()); if (asv != null) { throw new VmidcBrokerValidationException("Image file: " + dto.getImageUrl() + " already exists. Cannot add an image with the same name."); } }
ApplianceSoftwareVersionDtoValidator implements DtoValidator<ApplianceSoftwareVersionDto, ApplianceSoftwareVersion> { @Override public void validateForCreate(ApplianceSoftwareVersionDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); ApplianceSoftwareVersion asv = ApplianceSoftwareVersionEntityMgr.findByImageUrl(this.em, dto.getImageUrl()); if (asv != null) { throw new VmidcBrokerValidationException("Image file: " + dto.getImageUrl() + " already exists. Cannot add an image with the same name."); } } }
ApplianceSoftwareVersionDtoValidator implements DtoValidator<ApplianceSoftwareVersionDto, ApplianceSoftwareVersion> { @Override public void validateForCreate(ApplianceSoftwareVersionDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); ApplianceSoftwareVersion asv = ApplianceSoftwareVersionEntityMgr.findByImageUrl(this.em, dto.getImageUrl()); if (asv != null) { throw new VmidcBrokerValidationException("Image file: " + dto.getImageUrl() + " already exists. Cannot add an image with the same name."); } }  }
ApplianceSoftwareVersionDtoValidator implements DtoValidator<ApplianceSoftwareVersionDto, ApplianceSoftwareVersion> { @Override public void validateForCreate(ApplianceSoftwareVersionDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); ApplianceSoftwareVersion asv = ApplianceSoftwareVersionEntityMgr.findByImageUrl(this.em, dto.getImageUrl()); if (asv != null) { throw new VmidcBrokerValidationException("Image file: " + dto.getImageUrl() + " already exists. Cannot add an image with the same name."); } }  ApplianceSoftwareVersionDtoValidator create(EntityManager em); @Override void validateForCreate(ApplianceSoftwareVersionDto dto); @Override ApplianceSoftwareVersion validateForUpdate(ApplianceSoftwareVersionDto dto); }
ApplianceSoftwareVersionDtoValidator implements DtoValidator<ApplianceSoftwareVersionDto, ApplianceSoftwareVersion> { @Override public void validateForCreate(ApplianceSoftwareVersionDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); ApplianceSoftwareVersion asv = ApplianceSoftwareVersionEntityMgr.findByImageUrl(this.em, dto.getImageUrl()); if (asv != null) { throw new VmidcBrokerValidationException("Image file: " + dto.getImageUrl() + " already exists. Cannot add an image with the same name."); } }  ApplianceSoftwareVersionDtoValidator create(EntityManager em); @Override void validateForCreate(ApplianceSoftwareVersionDto dto); @Override ApplianceSoftwareVersion validateForUpdate(ApplianceSoftwareVersionDto dto);  }