From bf21908f6aeac303c8e2e13cff090290e9f35886 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Sat, 12 Aug 2023 09:53:30 +0000 Subject: 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 --- .../java/org/onap/aai/serialization/db/EdgeSerializer.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'aai-core/src/main') 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 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 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()); } -- cgit 1.2.3-korg