From 5a0703ffad1492ec6b6c78143f63dca83ee030d2 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Mon, 23 Aug 2021 19:41:50 +0100 Subject: Dynamically load CSAR validators for models Change-Id: I88ece0936e8a2814ef13dfa23eecda56de3dc6fe Issue-ID: SDC-3683 Signed-off-by: andre.schmid --- .../ci/tests/validation/pmdictionary/CsarValidationTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'integration-tests/src/test/java/org/onap') 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 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 errorList = validationResult.getErrors(); //then -- cgit 1.2.3-korg