From 66c0b9f8f59ea2ec91a1b96b78a61e5fafdd9830 Mon Sep 17 00:00:00 2001 From: "tobias.pobocik" Date: Wed, 13 Sep 2023 19:44:38 +0200 Subject: [PATCH] Refactor getting topology IDs Improve the return of this method and conditions to make it more readable. JIRA: LIGHTY-235 Signed-off-by: tobias.pobocik --- .../core/controller/springboot/rest/TopologyRestService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/TopologyRestService.java b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/TopologyRestService.java index 2a6d007ab3..7992ff4c06 100644 --- a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/TopologyRestService.java +++ b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/TopologyRestService.java @@ -65,7 +65,7 @@ public ResponseEntity getAllTopologyIdsOperational(Authentication authentication tx.read(LogicalDatastoreType.OPERATIONAL, iid).get(TIMEOUT, TimeUnit.SECONDS); if (readData.isPresent() && readData.get().getTopology() != null) { - final List topology = readData.get().getTopology().values().stream() + final List topology = readData.get().nonnullTopology().values().stream() .map(topology1 -> topology1.getTopologyId().getValue()) .collect(Collectors.toList()); return ResponseEntity.ok(topology);