diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-08-23 19:41:50 +0100 |
---|---|---|
committer | andre.schmid <andre.schmid@est.tech> | 2021-08-26 09:55:34 +0100 |
commit | 5a0703ffad1492ec6b6c78143f63dca83ee030d2 (patch) | |
tree | 202acfe75f4975051bd0b18d55b962ecd148fe7c /integration-tests | |
parent | 0c2661a7dfd1de644c7a3f9f42fc1883d3ceff78 (diff) |
Dynamically load CSAR validators for models
Change-Id: I88ece0936e8a2814ef13dfa23eecda56de3dc6fe
Issue-ID: SDC-3683
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'integration-tests')
-rw-r--r-- | integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/validation/pmdictionary/CsarValidationTest.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/validation/pmdictionary/CsarValidationTest.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/validation/pmdictionary/CsarValidationTest.java index 9500c9b378..7a4ad4da1e 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/validation/pmdictionary/CsarValidationTest.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/validation/pmdictionary/CsarValidationTest.java @@ -39,6 +39,8 @@ import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.validatio import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.validation.ValidatorFactory; class CsarValidationTest { + + private final ValidatorFactory validatorFactory = new ValidatorFactory(); @Test void shouldNotReturnErrors_whenPnfCsarIsValid() throws OnboardPackageException, IOException { @@ -46,7 +48,7 @@ class CsarValidationTest { FileContentHandler pnfFileContent = CsarLoader.load("validPnfCompliantWithSOL004.csar", "/Files/PNFs/validation/pmdictionary/validPnfCompliantWithSOL004.csar"); //when - final ValidationResult validationResult = ValidatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); + final ValidationResult validationResult = validatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); //then assertThat(validationResult.getErrors(), is(empty())); @@ -59,7 +61,7 @@ class CsarValidationTest { FileContentHandler pnfFileContent = CsarLoader.load("invalidPnfCompliantWithSOL004.csar", "/Files/PNFs/validation/pmdictionary/invalidPnfCompliantWithSOL004.csar"); //when - final ValidationResult validationResult = ValidatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); + final ValidationResult validationResult = validatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); List<ErrorMessage> errorList = validationResult.getErrors(); //then @@ -77,7 +79,7 @@ class CsarValidationTest { ); //when - final ValidationResult validationResult = ValidatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); + final ValidationResult validationResult = validatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); //then assertThat(validationResult.isValid(), is(true)); @@ -94,7 +96,7 @@ class CsarValidationTest { ); //when - final ValidationResult validationResult = ValidatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); + final ValidationResult validationResult = validatorFactory.getValidator(pnfFileContent).validate(pnfFileContent); List<ErrorMessage> errorList = validationResult.getErrors(); //then |