Extend ANR mock config to persist edit and delete 85/985/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Thu, 19 Sep 2019 17:04:27 +0000 (13:04 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 19 Sep 2019 17:09:18 +0000 (13:09 -0400)
Change-Id: Ided9b7aae94457b50ecc04b4322ee565212d8d3f
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
docs/release-notes.rst
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java
webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts

index 4fc7952..f90eb62 100644 (file)
@@ -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
 --------------------------
index bc18969..7408d3d 100644 (file)
@@ -169,6 +169,16 @@ public class AnrXappMockConfiguration {
                                logger.debug("deleteNcrt sleeping {}", delayMs);
                                Thread.sleep(delayMs);
                        }
+                       String servCellNrcgi = inv.<String>getArgument(0);
+                       String neighCellNrpci = inv.<String>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.<String>getArgument(0);
+                       String neighCellNrpci = inv.<String>getArgument(1);
+                       NeighborCellRelationMod mod = inv.<NeighborCellRelationMod>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;
index eaa2ca3..0514687 100644 (file)
@@ -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.');