aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/main/java
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2019-07-08 14:10:53 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-07-22 08:09:01 +0000
commit6043f67e7396e662f7814beca9760fdaf5058d6e (patch)
tree620e98f22fcd7785520ca54ac6d75030d283d993 /asdctool/src/main/java
parent2ca6a9f860889c17202d4a518eefc980a1bb139a (diff)
Improved the CsarGenerator unit tests.
Improved the CsarGeneratoryTest. Checkstyle for CsarGenerator and fixed typos. Issue-ID: SDC-2327 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: I8159dd47540ee3f5ed8b46f99c494c0cb24ed1d6
Diffstat (limited to 'asdctool/src/main/java')
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/internal/tool/CsarGenerator.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/internal/tool/CsarGenerator.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/internal/tool/CsarGenerator.java
index 4af684b30d..78f0ecbc88 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/internal/tool/CsarGenerator.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/internal/tool/CsarGenerator.java
@@ -84,14 +84,14 @@ public class CsarGenerator extends CommonInternalTool {
props.put(GraphPropertyEnum.STATE, LifecycleStateEnum.CERTIFIED.name());
props.put(GraphPropertyEnum.COMPONENT_TYPE, ComponentTypeEnum.SERVICE.name());
- List<GraphVertex> byCriterria = janusGraphDao
+ List<GraphVertex> byCriteria = janusGraphDao
.getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, props).either(l -> l, r -> null);
- if (byCriterria != null && !byCriterria.isEmpty()) {
- if (byCriterria.size() > 1) {
+ if (byCriteria != null && !byCriteria.isEmpty()) {
+ if (byCriteria.size() > 1) {
ConsoleWriter.dataLine("Warning ! More that 1 certified service with uuid", uuid);
// TBD
} else {
- GraphVertex metadataV = byCriterria.get(0);
+ GraphVertex metadataV = byCriteria.get(0);
printComponentInfo(metadataV.getMetadataProperties());
ConsoleWriter.dataLine("\nGenerate CSAR (yes/no)?");
@@ -102,7 +102,7 @@ public class CsarGenerator extends CommonInternalTool {
}
}
} else {
- ConsoleWriter.dataLine("No certified service with UUID", uuid);
+ ConsoleWriter.dataLine("No certified service with UUID ", uuid);
}
if (status == JanusGraphOperationStatus.OK) {
janusGraphDao.commit();
@@ -131,14 +131,14 @@ public class CsarGenerator extends CommonInternalTool {
}
} else {
- ConsoleWriter.dataLine("Failed to fetch certified service with UUID", uuid);
+ ConsoleWriter.dataLine("Failed to fetch certified service with UUID ", uuid);
}
return status;
}
private JanusGraphOperationStatus generateArtifact(Component component, ArtifactTypeEnum artifactType, Supplier<byte[]> supplier){
JanusGraphOperationStatus status = JanusGraphOperationStatus.GENERAL_ERROR;
- ArtifactDefinition csarArtifact = null;
+ ArtifactDefinition csarArtifact;
Optional<ArtifactDefinition> op = component.getToscaArtifacts().values().stream().filter(p -> p.getArtifactType().equals(artifactType.getType())).findAny();
if (op.isPresent()) {
csarArtifact = op.get();
@@ -162,7 +162,7 @@ public class CsarGenerator extends CommonInternalTool {
ConsoleWriter.dataLine("create artifact failed ", csarArtifact.getArtifactLabel());
return JanusGraphOperationStatus.GENERAL_ERROR;
}
- ConsoleWriter.dataLine("createartifact success ", csarArtifact.getArtifactLabel());
+ ConsoleWriter.dataLine("create artifact success ", csarArtifact.getArtifactLabel());
csarArtifact.setPayload(payload);
byte[] decodedPayload = csarArtifact.getPayloadData();