summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-08-12 09:53:30 +0000
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-08-16 11:22:56 +0000
commitbf21908f6aeac303c8e2e13cff090290e9f35886 (patch)
tree37fdc2c409121054b595565bb477d3cf9014f04d /aai-core/src/main
parent1c1f0dc110177a190c67e3a8b924542ce4d75ff8 (diff)
Refactor HttpEntryTest
- make test cases independently runnable by removing shared state - let method naming better reflect what is being tested - assign commonly used objects on the class level when they are not modified in the test case - parse error response object and assert error messages Other: - remove unnecessary saving in map in EdgeSerializer Issue-ID: AAI-3658 Change-Id: I3b9704b8a6b6cfa6ecf4930dc3b1d1a7ce84764a Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-core/src/main')
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java
index a5a08203..0c58717e 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java
@@ -207,15 +207,9 @@ public class EdgeSerializer {
* @param rule the rule
*/
public void addProperties(Edge edge, EdgeRule rule) {
- Map<EdgeProperty, String> propMap = new EnumMap<>(EdgeProperty.class);
- propMap.put(EdgeProperty.CONTAINS, rule.getContains());
- propMap.put(EdgeProperty.DELETE_OTHER_V, rule.getDeleteOtherV());
- propMap.put(EdgeProperty.PREVENT_DELETE, rule.getPreventDelete());
-
- for (Entry<EdgeProperty, String> entry : propMap.entrySet()) {
- edge.property(entry.getKey().toString(), entry.getValue());
- }
-
+ edge.property(EdgeProperty.CONTAINS.toString(), rule.getContains());
+ edge.property(EdgeProperty.DELETE_OTHER_V.toString(), rule.getDeleteOtherV());
+ edge.property(EdgeProperty.PREVENT_DELETE.toString(), rule.getPreventDelete());
edge.property(EdgeField.PRIVATE.toString(), rule.isPrivateEdge());
edge.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString());
}