summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2023-02-23 15:49:40 +0000
committerToineSiebelink <toine.siebelink@est.tech>2023-02-27 16:11:01 +0000
commit048350463a68b774f42e80e94afe16a541711ae4 (patch)
tree56d9d921813419d39fdd5e9cb7ebe47109f046ca /cps-service/src/main
parent003de55a8e6c53643032731e68edc43c0698fd81 (diff)
Expand CPS Service Integration Test (framework)
- Created package structure - Created several test bases - Created complete test set for Admin service - Created first test for Data service - Added human-readable toString() to FetchDescendantsOption for test reporting and debuging purposes - Renamed fetch descendants (enum) direct children option for consistency with others options - TODO: Add sample performance test (and base) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I75317686161be41662b6bf81314a9cd425ddd6eb
Diffstat (limited to 'cps-service/src/main')
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java b/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java
index 0c8cddcd7..cf5e04dc4 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Pantheon.tech
- * Copyright (C) 2022 Nordix Foundation
+ * Copyright (C) 2022-2023 Nordix Foundation
* Modifications Copyright (C) 2023 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,15 +30,24 @@ import org.onap.cps.spi.exceptions.DataValidationException;
@RequiredArgsConstructor
public class FetchDescendantsOption {
- public static final FetchDescendantsOption FETCH_DIRECT_CHILDREN_ONLY = new FetchDescendantsOption(1);
- public static final FetchDescendantsOption OMIT_DESCENDANTS = new FetchDescendantsOption(0);
- public static final FetchDescendantsOption INCLUDE_ALL_DESCENDANTS = new FetchDescendantsOption(-1);
+ public static final FetchDescendantsOption DIRECT_CHILDREN_ONLY
+ = new FetchDescendantsOption(1, "DirectChildrenOnly");
+ public static final FetchDescendantsOption OMIT_DESCENDANTS
+ = new FetchDescendantsOption(0, "OmitDescendants");
+ public static final FetchDescendantsOption INCLUDE_ALL_DESCENDANTS
+ = new FetchDescendantsOption(-1, "IncludeAllDescendants");
+
+ FetchDescendantsOption(final int depth) {
+ this(depth, "Depth=" + depth);
+ }
private static final Pattern FETCH_DESCENDANTS_OPTION_PATTERN =
Pattern.compile("^$|^all$|^none$|^[0-9]+$|^-1$");
private final int depth;
+ private final String optionName;
+
/**
* Has next depth.
*
@@ -85,6 +94,11 @@ public class FetchDescendantsOption {
}
}
+ @Override
+ public String toString() {
+ return optionName;
+ }
+
private static void validateFetchDescendantsOption(final String fetchDescendantsOptionAsString) {
if (Strings.isNullOrEmpty(fetchDescendantsOptionAsString)) {
return;