aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-03-25 19:30:14 +0000
committerandre.schmid <andre.schmid@est.tech>2022-03-31 18:19:04 +0100
commit115b2ef065fa652b380093e4f2571e53c3f0bc19 (patch)
treec325e09c003f2d8d55b09692ffbd4e79e53da3aa /openecomp-be/lib
parent6cffd9e3eecb10281d880ea7d217f0ecddf8fb5a (diff)
Fix package storage and reducer config reload
The package storage configuration was not being reloaded when a configuration file change was made. Increases OrchestrationTemplateCandidateImpl coverage by testing the upload to the artifact storage. Issue-ID: SDC-3934 Change-Id: I533b3c3a92cdadb60a375890da85ee053364e8af Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/lib')
-rw-r--r--openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java3
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java5
2 files changed, 5 insertions, 3 deletions
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
index 65906bd3d2..2ed67b3963 100644
--- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
@@ -210,7 +210,8 @@ public enum Messages {
EXTERNAL_CSAR_STORE_CONFIGURATION_FAILURE_MISSING("externalCsarStore configuration failure, missing '%s'"),
ERROR_HAS_OCCURRED_WHILE_PERSISTING_THE_ARTIFACT("An error has occurred while persisting the artifact: %s"),
ERROR_HAS_OCCURRED_WHILE_REDUCING_THE_ARTIFACT_SIZE("An error has occurred while reducing the artifact's size: %s"),
- UNEXPECTED_PROBLEM_HAPPENED_WHILE_GETTING("An unexpected problem happened while getting '%s'");
+ UNEXPECTED_PROBLEM_HAPPENED_WHILE_GETTING("An unexpected problem happened while getting '%s'"),
+ PACKAGE_REDUCER_NOT_CONFIGURED("Could not process the package. Package reducer is not configured");
// @formatter:on
private final String errorMessage;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
index fbb25de0da..f18e15efb7 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
@@ -54,12 +54,12 @@ public class OrchestrationTemplateCandidateDaoZusammenImpl implements Orchestrat
private static final Logger LOGGER = LoggerFactory.getLogger(OrchestrationTemplateCandidateDaoZusammenImpl.class);
private static final String EMPTY_DATA = "{}";
private final ZusammenAdaptor zusammenAdaptor;
- private final ArtifactStorageManager artifactStorageManager;
+ private final StorageFactory storageFactory;
public OrchestrationTemplateCandidateDaoZusammenImpl(final ZusammenAdaptor zusammenAdaptor) {
this.zusammenAdaptor = zusammenAdaptor;
LOGGER.info("Instantiating artifactStorageManager");
- this.artifactStorageManager = new StorageFactory().createArtifactStorageManager();
+ this.storageFactory = new StorageFactory();
}
@Override
@@ -158,6 +158,7 @@ public class OrchestrationTemplateCandidateDaoZusammenImpl implements Orchestrat
final String originalFileSuffix = candidateData.getOriginalFileSuffix();
originalPackageElement.getInfo().addProperty(InfoPropertyName.ORIGINAL_FILE_NAME.getVal(), originalFileName);
originalPackageElement.getInfo().addProperty(InfoPropertyName.ORIGINAL_FILE_SUFFIX.getVal(), originalFileSuffix);
+ final ArtifactStorageManager artifactStorageManager = storageFactory.createArtifactStorageManager();
originalPackageElement.getInfo().addProperty("storeCsarsExternally", artifactStorageManager.isEnabled());
if (artifactStorageManager.isEnabled()) {
final ArtifactInfo candidateArtifactInfo = candidateData.getArtifactInfo();