From 8da0a6ad3c28a52860d6c29b062462fe2abe39e0 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Thu, 19 Sep 2019 13:04:27 -0400 Subject: [PATCH] Extend ANR mock config to persist edit and delete Change-Id: Ided9b7aae94457b50ecc04b4322ee565212d8d3f Signed-off-by: Lott, Christopher (cl778h) --- docs/release-notes.rst | 1 + .../dashboard/config/AnrXappMockConfiguration.java | 23 ++++++++++++++++++++++ .../src/app/anr-xapp/anr-xapp.component.ts | 1 + 3 files changed, 25 insertions(+) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 4fc79527..f90eb62e 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -27,6 +27,7 @@ Version 1.2.1, 19 Sep 2019 -------------------------- * Repair E2 URLs in front end like endc-setup/endcSetup * Trim whitespace in form input strings +* Extend ANR mock feature to persist edits for demos Version 1.2.0, 11 Sep 2019 -------------------------- diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java index bc189693..7408d3dc 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java @@ -169,6 +169,16 @@ public class AnrXappMockConfiguration { logger.debug("deleteNcrt sleeping {}", delayMs); Thread.sleep(delayMs); } + String servCellNrcgi = inv.getArgument(0); + String neighCellNrpci = inv.getArgument(1); + for (NeighborCellRelation ncr : ncrt.getNcrtRelations()) { + if (servCellNrcgi.equals(ncr.getServingCellNrcgi()) + && neighCellNrpci.equals(ncr.getNeighborCellNrpci())) { + logger.debug("deleteNcrt: removing {}", ncr); + ncrt.getNcrtRelations().remove(ncr); + break; + } + } return null; }).when(mockApi).deleteNcrt(any(String.class), any(String.class)); doAnswer(inv -> { @@ -176,6 +186,19 @@ public class AnrXappMockConfiguration { logger.debug("modifyNcrt sleeping {}", delayMs); Thread.sleep(delayMs); } + String servCellNrcgi = inv.getArgument(0); + String neighCellNrpci = inv.getArgument(1); + NeighborCellRelationMod mod = inv.getArgument(2); + for (NeighborCellRelation ncr : ncrt.getNcrtRelations()) { + if (servCellNrcgi.equals(ncr.getServingCellNrcgi()) + && neighCellNrpci.equals(ncr.getNeighborCellNrpci())) { + logger.debug("modifyNcrt: modifying {} to {}", ncr, mod); + ncr.setFlagNoHo(mod.isFlagNoHo()); + ncr.setFlagNoRemove(mod.isFlagNoRemove()); + ncr.setFlagNoXn(mod.isFlagNoXn()); + break; + } + } return null; }).when(mockApi).modifyNcrt(any(String.class), any(String.class), any(NeighborCellRelationMod.class)); return mockApi; diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts index eaa2ca39..05146876 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts +++ b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts @@ -122,6 +122,7 @@ export class AnrXappComponent implements AfterViewInit, OnInit { switch (response.status) { case 200: this.notificationService.success('Delete succeeded!'); + this.loadNcrtPage(); break; default: this.notificationService.warn('Delete failed.'); -- 2.16.6