summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java/org
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-01-11 19:19:05 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-01-17 10:44:23 +0000
commit035ad742f60bdb375ee4e2da4345d404949a19b4 (patch)
tree7d40e43a0d6422036403cf1f0d3bbfd3248fa61a /catalog-model/src/main/java/org
parentc29a4519545ff509c038c9a19781ef210b2ee14f (diff)
Improve test coverage
- extract duplicated code - remove redundant and unused code Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I7ae3592951f53bbebf10a80f7cce22d54b2940b6 Issue-ID: SDC-4317
Diffstat (limited to 'catalog-model/src/main/java/org')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
index 65c109c3f6..910d7ae1b6 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
@@ -1021,8 +1021,7 @@ public abstract class ToscaElementOperation extends BaseOperation {
protected JanusGraphOperationStatus setResourceCategoryFromGraphV(Vertex vertex, CatalogComponent catalogComponent) {
List<CategoryDefinition> categories = new ArrayList<>();
SubCategoryDefinition subcategory;
- Either<Vertex, JanusGraphOperationStatus> childVertex = janusGraphDao
- .getChildVertex(vertex, EdgeLabelEnum.CATEGORY, JsonParseFlagEnum.NoParse);
+ Either<Vertex, JanusGraphOperationStatus> childVertex = janusGraphDao.getChildVertex(vertex, EdgeLabelEnum.CATEGORY);
if (childVertex.isRight()) {
log.debug(FAILED_TO_FETCH_FOR_TOSCA_ELEMENT_WITH_ID_ERROR, EdgeLabelEnum.CATEGORY, catalogComponent.getUniqueId(),
childVertex.right().value());
@@ -1041,8 +1040,7 @@ public abstract class ToscaElementOperation extends BaseOperation {
.fromJson((String) subCategoryV.property(GraphPropertyEnum.METADATA_KEYS.getProperty()).value(), listTypeSubcat)
: Collections.emptyList();
subcategory.setMetadataKeys(metadataKeys);
- Either<Vertex, JanusGraphOperationStatus> parentVertex = janusGraphDao
- .getParentVertex(subCategoryV, EdgeLabelEnum.SUB_CATEGORY, JsonParseFlagEnum.NoParse);
+ Either<Vertex, JanusGraphOperationStatus> parentVertex = janusGraphDao.getParentVertex(subCategoryV, EdgeLabelEnum.SUB_CATEGORY);
Vertex categoryV = parentVertex.left().value();
String categoryNormalizedName = (String) categoryV.property(GraphPropertyEnum.NORMALIZED_NAME.getProperty()).value();
catalogComponent.setCategoryNormalizedName(categoryNormalizedName);
@@ -1058,8 +1056,7 @@ public abstract class ToscaElementOperation extends BaseOperation {
protected JanusGraphOperationStatus setServiceCategoryFromGraphV(Vertex vertex, CatalogComponent catalogComponent) {
List<CategoryDefinition> categories = new ArrayList<>();
- Either<Vertex, JanusGraphOperationStatus> childVertex = janusGraphDao
- .getChildVertex(vertex, EdgeLabelEnum.CATEGORY, JsonParseFlagEnum.NoParse);
+ Either<Vertex, JanusGraphOperationStatus> childVertex = janusGraphDao.getChildVertex(vertex, EdgeLabelEnum.CATEGORY);
if (childVertex.isRight()) {
log.debug(FAILED_TO_FETCH_FOR_TOSCA_ELEMENT_WITH_ID_ERROR, EdgeLabelEnum.CATEGORY, catalogComponent.getUniqueId(),
childVertex.right().value());
@@ -1338,7 +1335,7 @@ public abstract class ToscaElementOperation extends BaseOperation {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
Map<String, CatalogComponent> existInCatalog = new HashMap<>();
- Either<Iterator<Vertex>, JanusGraphOperationStatus> verticesEither = janusGraphDao.getCatalogOrArchiveVerticies(isCatalog);
+ Either<Iterator<Vertex>, JanusGraphOperationStatus> verticesEither = janusGraphDao.getCatalogOrArchiveVertices(isCatalog);
if (verticesEither.isRight()) {
return Either.right(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(verticesEither.right().value()));
}