private Optional<ValidationResponse> submit(String vspId, Version version, String message,
String user) throws IOException {
- ValidationResponse validationResponse = vendorSoftwareProductManager.validate(vspId, version);
+ VspDetails vspDetails = vendorSoftwareProductManager.getVsp(vspId, version);
+ vspDetails.setVlmVersion(versioningManager.get(vspDetails.getVendorId(),vspDetails.getVlmVersion()));
+ ValidationResponse validationResponse = vendorSoftwareProductManager.validate(vspDetails);
Map<String, List<ErrorMessage>> compilationErrors =
vendorSoftwareProductManager.compile(vspId, version);
if (!validationResponse.isValid() || MapUtils.isNotEmpty(compilationErrors)) {
void deleteVsp(String vspId, Version version);
- ValidationResponse validate(String vspId, Version version) throws IOException;
+ ValidationResponse validate(VspDetails vspDetails) throws IOException;
Map<String, List<ErrorMessage>> compile(String vspId, Version version);
}
@Override
- public ValidationResponse validate(String vspId, Version version) throws IOException {
- VspDetails vspDetails = getValidatedVsp(vspId, version);
+ public ValidationResponse validate(VspDetails vspDetails) throws IOException {
List<ErrorCode> vspErrors = new ArrayList<>(validateVspFields(vspDetails));
ValidationResponse validationResponse = new ValidationResponse();
if (Objects.nonNull(vspDetails.getOnboardingMethod())
&& OnboardingMethod.Manual.name().equals(vspDetails.getOnboardingMethod())) {
validateManualOnboardingMethod(vspDetails, validationResponse, vspErrors);
} else {
- validateOrchestrationTemplateCandidate(validationResponse, vspErrors, vspId, version);
+ validateOrchestrationTemplateCandidate(validationResponse, vspErrors, vspDetails.getId(), vspDetails.getVersion());
if (!validationResponse.isValid()) {
return validationResponse;
}
vspErrors.addAll(validateMandatoryLicenseFields(vspDetails));
}
OrchestrationTemplateEntity orchestrationTemplate =
- orchestrationTemplateDao.get(vspId, version);
+ orchestrationTemplateDao.get(vspDetails.getId(), vspDetails.getVersion());
ToscaServiceModel serviceModel =
- serviceModelDao.getServiceModel(vspId, vspDetails.getVersion());
+ serviceModelDao.getServiceModel( vspDetails.getId(), vspDetails.getVersion());
if (isOrchestrationTemplateMissing(orchestrationTemplate)
|| isServiceModelMissing(serviceModel)) {
vspErrors.add(VendorSoftwareProductInvalidErrorBuilder
}
Collection<ComponentDependencyModelEntity> componentDependencies =
- componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspId, version, null));
+ componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspDetails.getId(), vspDetails.getVersion(), null));
if (validateComponentDependencies(componentDependencies)) {
vspErrors
.when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
ValidationResponse validationResponse =
- vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
+ vendorSoftwareProductManager.validate(vsp);
Assert.assertNotNull(validationResponse);
Assert.assertFalse(validationResponse.isValid());
Assert.assertNull(validationResponse.getVspErrors());
.when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
ValidationResponse validationResponse =
- vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
+ vendorSoftwareProductManager.validate(vsp);
Assert.assertTrue(validationResponse.isValid());
/* Assert.assertEquals(vsp2.getVersionInfo().getVersion(), VERSION10);
.when(orchestrationTemplateCandidateManagerMock)
.getInfo(VSP_ID, VERSION01);
ValidationResponse validationResponse =
- vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
+ vendorSoftwareProductManager.validate(vsp);
Assert.assertNotNull(validationResponse);
Assert.assertFalse(validationResponse.isValid());
Assert.assertNotNull(validationResponse.getVspErrors());
.when(orchestrationTemplateCandidateManagerMock)
.getInfo(VSP_ID, VERSION01);
ValidationResponse validationResponse =
- vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
+ vendorSoftwareProductManager.validate(vsp);
Assert.assertNotNull(validationResponse);
Assert.assertFalse(validationResponse.isValid());
Assert.assertNotNull(validationResponse.getVspErrors());