@Test public void testValidateforCreate_UsingValidNewModel_Suceeds() throws Exception { ApplianceDto dto = new ApplianceDto(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString()); this.validator.validateForCreate(dto); }
@Override public void validateForCreate(ApplianceDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel()); if (existingAppliance != null) { throw new VmidcBrokerValidationException("Appliance already exists for model: " + dto.getModel()); } }
ApplianceDtoValidator implements DtoValidator<ApplianceDto, Appliance> { @Override public void validateForCreate(ApplianceDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel()); if (existingAppliance != null) { throw new VmidcBrokerValidationException("Appliance already exists for model: " + dto.getModel()); } } }
ApplianceDtoValidator implements DtoValidator<ApplianceDto, Appliance> { @Override public void validateForCreate(ApplianceDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel()); if (existingAppliance != null) { throw new VmidcBrokerValidationException("Appliance already exists for model: " + dto.getModel()); } }  }
ApplianceDtoValidator implements DtoValidator<ApplianceDto, Appliance> { @Override public void validateForCreate(ApplianceDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel()); if (existingAppliance != null) { throw new VmidcBrokerValidationException("Appliance already exists for model: " + dto.getModel()); } }  ApplianceDtoValidator create(EntityManager em); @Override void validateForCreate(ApplianceDto dto); @Override Appliance validateForUpdate(ApplianceDto dto); }
ApplianceDtoValidator implements DtoValidator<ApplianceDto, Appliance> { @Override public void validateForCreate(ApplianceDto dto) throws Exception { checkForNullFields(dto); checkFieldLength(dto); Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel()); if (existingAppliance != null) { throw new VmidcBrokerValidationException("Appliance already exists for model: " + dto.getModel()); } }  ApplianceDtoValidator create(EntityManager em); @Override void validateForCreate(ApplianceDto dto); @Override Appliance validateForUpdate(ApplianceDto dto);  }