Split URL properties into prefix/suffix 88/488/5
authorLott, Christopher (cl778h) <cl778h@att.com>
Tue, 9 Jul 2019 17:43:29 +0000 (13:43 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Tue, 9 Jul 2019 19:54:09 +0000 (15:54 -0400)
Bump version to 1.2.0.
Upgrade to Junit5.
Address some minor Sonar complaints.
Support Java 9 and later.

Change-Id: I3205e4c294f0826d363e591ce9881a4f25e0cfa2
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
39 files changed:
.gitignore
a1-med-client/pom.xml
a1-med-client/src/test/java/org/oransc/ric/portal/dashboard/a1med/client/test/A1MediatorClientTest.java
anr-xapp-client/pom.xml
anr-xapp-client/src/test/java/org/oransc/ric/portal/dashboard/anrxapp/client/test/AnrXappClientTest.java
app-mgr-client/pom.xml
app-mgr-client/src/test/java/org/oransc/ric/portal/dashboard/appmgr/client/test/AppManagerClientTest.java
docs/release-notes.rst
e2-mgr-client/pom.xml
e2-mgr-client/src/test/java/org/oransc/ric/portal/dashboard/e2mgr/client/test/E2ManagerClientTest.java
pom.xml
webapp-backend/pom.xml
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/A1MediatorConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AppManagerConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AcXappController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AdminController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AppManagerController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/CustomizedResponseEntityExceptionHandler.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/SimpleErrorController.java
webapp-backend/src/main/resources/application.properties
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AbstractControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/AbstractControllerTest.java with 87% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AcXappControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/AcXappControllerTest.java with 87% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AdminControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/AdminControllerTest.java with 84% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AnrXappControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/AnrXappControllerTest.java with 84% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AppManagerControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/AppManagerControllerTest.java with 85% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/DefaultContextTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DefaultContextTest.java with 76% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/E2ManagerControllerTest.java [moved from webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/E2ManagerControllerTest.java with 85% similarity]
webapp-frontend/pom.xml
webapp-frontend/src/app/main/main.component.html [moved from webapp-frontend/src/app/login/login.component.html with 100% similarity]
webapp-frontend/src/app/main/main.component.scss [moved from webapp-frontend/src/app/login/login.component.scss with 100% similarity]
webapp-frontend/src/app/main/main.component.spec.ts [moved from webapp-frontend/src/app/login/login.component.spec.ts with 81% similarity]
webapp-frontend/src/app/main/main.component.ts [moved from webapp-frontend/src/app/login/login.component.ts with 85% similarity]
webapp-frontend/src/app/rd-routing.module.ts
webapp-frontend/src/app/rd.module.ts

index b3a7f27..175c380 100644 (file)
@@ -1,5 +1,7 @@
 # See http://help.github.com/ignore-files/ for more about ignoring files.
 
+/logs
+
 # compiled output
 /dist
 /tmp
index ba486c3..91a3126 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <!-- This groupId will NOT allow deployment in LF -->
        <groupId>org.o-ran-sc.ric.plt.a1med.client</groupId>
@@ -42,6 +42,11 @@ limitations under the License.
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
+               <!-- Required for Java 9 and later -->
+               <dependency>
+                       <groupId>javax.annotation</groupId>
+                       <artifactId>javax.annotation-api</artifactId>
+               </dependency>
                <dependency>
                        <groupId>io.swagger.core.v3</groupId>
                        <artifactId>swagger-annotations</artifactId>
@@ -124,30 +129,6 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
-                       <!-- Require Java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <!-- Spring sets the <version></version> -->
-                               <configuration>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                       </plugin>
-                       <!-- Generate source jar -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                               <!-- <version>3.0.0</version> -->
-                               <executions>
-                                       <execution>
-                                               <id>attach-sources</id>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
                        <!-- add build information to manifest. Java provides access to the implementation 
                                version for a package, so cram the build number into there. -->
                        <plugin>
@@ -165,15 +146,6 @@ limitations under the License.
                                        </archive>
                                </configuration>
                        </plugin>
-                       <!-- Skip the deploy-jar-to-nexus step -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                               <!-- Spring sets the <version>2.8</version> -->
-                               <configuration>
-                                       <skip>true</skip>
-                               </configuration>
-                       </plugin>
                </plugins>
                <pluginManagement>
                        <plugins>
index d8d5193..c09858e 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.oransc.ric.portal.dashboard.a1med.client.test;
 
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.oransc.ric.a1med.client.api.A1MediatorApi;
 import org.oransc.ric.a1med.client.invoker.ApiClient;
@@ -39,6 +40,7 @@ public class A1MediatorClientTest {
                try {
                        a1Api.a1ControllerGetHandler("policy");
                        System.out.println("getPolicy answered: " + apiClient.getStatusCode().toString());
+                       Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful());
                } catch (RestClientException e) {
                        System.err.println("getPolicy failed: " + e.toString());
                }
index b99e68c..956918e 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <!-- This groupId will NOT allow deployment in LF -->
        <groupId>org.o-ran-sc.ric.xapp.anr.client</groupId>
@@ -42,6 +42,11 @@ limitations under the License.
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
+               <!-- Required for Java 9 and later -->
+               <dependency>
+                       <groupId>javax.annotation</groupId>
+                       <artifactId>javax.annotation-api</artifactId>
+               </dependency>
                <dependency>
                        <groupId>io.swagger</groupId>
                        <artifactId>swagger-annotations</artifactId>
@@ -124,30 +129,6 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
-                       <!-- Require Java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <!-- Spring sets the <version></version> -->
-                               <configuration>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                       </plugin>
-                       <!-- Generate source jar -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                               <!-- <version>3.0.0</version> -->
-                               <executions>
-                                       <execution>
-                                               <id>attach-sources</id>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
                        <!-- add build information to manifest. Java provides access to the implementation 
                                version for a package, so cram the build number into there. -->
                        <plugin>
@@ -165,15 +146,6 @@ limitations under the License.
                                        </archive>
                                </configuration>
                        </plugin>
-                       <!-- Skip the deploy-jar-to-nexus step -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                               <!-- Spring sets the <version>2.8</version> -->
-                               <configuration>
-                                       <skip>true</skip>
-                               </configuration>
-                       </plugin>
                </plugins>
                <pluginManagement>
                        <plugins>
index eee796e..ffa64f2 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.oransc.ric.portal.dashboard.anrxapp.client.test;
 
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.oransc.ric.anrxapp.client.api.HealthApi;
 import org.oransc.ric.anrxapp.client.invoker.ApiClient;
@@ -39,6 +40,7 @@ public class AnrXappClientTest {
                try {
                        healthApi.getHealthAlive();
                        System.out.println("getHealthAlive answered: " + apiClient.getStatusCode().toString());
+                       Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful());
                } catch (RestClientException e) {
                        System.err.println("getHealthAlive failed: " + e.toString());
                }
index 1673d73..9c0276d 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <!-- This groupId will NOT allow deployment in LF -->
        <groupId>org.o-ran-sc.ric.plt.appmgr.client</groupId>
@@ -42,6 +42,11 @@ limitations under the License.
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
+               <!-- Required for Java 9 and later -->
+               <dependency>
+                       <groupId>javax.annotation</groupId>
+                       <artifactId>javax.annotation-api</artifactId>
+               </dependency>
                <dependency>
                        <groupId>io.swagger</groupId>
                        <artifactId>swagger-annotations</artifactId>
@@ -124,30 +129,6 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
-                       <!-- Require Java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <!-- Spring sets the <version></version> -->
-                               <configuration>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                       </plugin>
-                       <!-- Generate source jar -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                               <!-- <version>3.0.0</version> -->
-                               <executions>
-                                       <execution>
-                                               <id>attach-sources</id>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
                        <!-- add build information to manifest. Java provides access to the implementation 
                                version for a package, so cram the build number into there. -->
                        <plugin>
@@ -165,15 +146,6 @@ limitations under the License.
                                        </archive>
                                </configuration>
                        </plugin>
-                       <!-- Skip the deploy-jar-to-nexus step -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                               <!-- Spring sets the <version>2.8</version> -->
-                               <configuration>
-                                       <skip>true</skip>
-                               </configuration>
-                       </plugin>
                </plugins>
                <pluginManagement>
                        <plugins>
index a52d831..9cba057 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.oransc.ric.portal.dashboard.appmgr.client.test;
 
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.oransc.ric.plt.appmgr.client.api.HealthApi;
 import org.oransc.ric.plt.appmgr.client.api.XappApi;
@@ -42,6 +43,7 @@ public class AppManagerClientTest {
                        HealthApi healthApi = new HealthApi(apiClient);
                        healthApi.getHealthAlive();
                        System.out.println("getHealthAlive answered: " + apiClient.getStatusCode().toString());
+                       Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful());
                } catch (RestClientException e) {
                        System.err.println("getHealthAlive failed: " + e.toString());
                }
@@ -49,6 +51,7 @@ public class AppManagerClientTest {
                        XappApi xappApi = new XappApi(apiClient);
                        AllDeployedXapps allXapps = xappApi.getAllXapps();
                        System.out.println("getAllXapps answered: " + apiClient.getStatusCode().toString());
+                       Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful());
                        System.out.println("xApp count: " + allXapps.size());
                        for (Xapp x : allXapps)
                                System.out.println("xApp: " + x.toString());
index aefe717..d046a73 100644 (file)
 RIC Dashboard Release Notes
 ===========================
 
+Version 1.2.0, 9 July 2019
+--------------------------
+* Split URL properties into prefix/suffix parts
+* Add jacoco plugin to back-end for code coverage
+
 Version 1.0.5, 5 July 2019
 --------------------------
 * Upgrade to Angular version 8
index 99f1074..021fe68 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <!-- This groupId will NOT allow deployment in LF -->
        <groupId>org.o-ran-sc.ric.plt.e2mgr.client</groupId>
@@ -42,6 +42,11 @@ limitations under the License.
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
+               <!-- Required for Java 9 and later -->
+               <dependency>
+                       <groupId>javax.annotation</groupId>
+                       <artifactId>javax.annotation-api</artifactId>
+               </dependency>
                <dependency>
                        <groupId>io.swagger.core.v3</groupId>
                        <artifactId>swagger-annotations</artifactId>
@@ -124,54 +129,21 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
-                       <!-- Require Java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <!-- Spring sets the <version></version> -->
-                               <configuration>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                       </plugin>
-                       <!-- Generate source jar -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                               <!-- <version>3.0.0</version> -->
-                               <executions>
-                                       <execution>
-                                               <id>attach-sources</id>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-       <!-- add build information to manifest. Java provides access to the implementation 
-               version for a package, so cram the build number into there. -->
-       <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-jar-plugin</artifactId>
-               <!-- version>2.5</version> -->
-               <configuration>
-                       <archive>
-                               <manifest>
-                                       <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
-                               </manifest>
-                               <manifestEntries>
-                                       <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
-                               </manifestEntries>
-                       </archive>
-               </configuration>
-       </plugin>
-                       <!-- Skip the deploy-jar-to-nexus step -->
+                       <!-- add build information to manifest. Java provides access to the implementation 
+                               version for a package, so cram the build number into there. -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                               <!-- Spring sets the <version>2.8</version> -->
+                               <artifactId>maven-jar-plugin</artifactId>
+                               <!-- version>2.5</version> -->
                                <configuration>
-                                       <skip>true</skip>
+                                       <archive>
+                                               <manifest>
+                                                       <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                                               </manifest>
+                                               <manifestEntries>
+                                                       <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
+                                               </manifestEntries>
+                                       </archive>
                                </configuration>
                        </plugin>
                </plugins>
index 7916cb9..397277a 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.oransc.ric.portal.dashboard.e2mgr.client.test;
 
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
 import org.oransc.ric.e2mgr.client.invoker.ApiClient;
@@ -39,6 +40,7 @@ public class E2ManagerClientTest {
                try {
                        healthApi.healthGet();
                        System.out.println("getHealth answered: " + apiClient.getStatusCode().toString());
+                       Assertions.assertTrue(apiClient.getStatusCode().is2xxSuccessful());
                } catch (RestClientException e) {
                        System.err.println("getHealth failed: " + e.toString());
                }
diff --git a/pom.xml b/pom.xml
index de48cf5..8fd45a3 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,9 +33,10 @@ limitations under the License.
        <artifactId>ric-dash-parent</artifactId>
        <name>RIC Dashboard project</name>
        <packaging>pom</packaging>
-       <version>1.0.5-SNAPSHOT</version>
-       <!-- Properties for the license-maven-plugin in child POMs -->
+       <version>1.2.0-SNAPSHOT</version>
        <properties>
+               <java.version>8</java.version>
+               <!-- Properties for the license-maven-plugin in child POMs -->
                <lmp.organization.name>AT&amp;T Intellectual Property and Nokia</lmp.organization.name>
                <lmp.project.name>O-RAN-SC</lmp.project.name>
                <lmp.inception.year>2019</lmp.inception.year>
@@ -53,11 +54,39 @@ limitations under the License.
        </modules>
        <build>
                <plugins>
-                       <!-- do not deploy the root pom, only needed for build -->
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                               <configuration>
+                                       <source>${java.version}</source>
+                                       <target>${java.version}</target>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+                               <configuration>
+                                       <!-- For Java 9 and later -->
+                                       <forkCount>0</forkCount>
+                               </configuration>
+                       </plugin>
+                       <!-- Always generate a source jar -->
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>attach-sources</id>
+                                               <goals>
+                                                       <goal>jar</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- Always skip the deploy-jar-to-nexus step -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-deploy-plugin</artifactId>
-                               <!--  spring sets the <version>2.8</version> -->
                                <configuration>
                                        <skip>true</skip>
                                </configuration>
index ed53758..01362c6 100644 (file)
@@ -25,12 +25,11 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <artifactId>ric-dash-be</artifactId>
        <name>RIC Dashboard Webapp backend</name>
        <properties>
-               <java.version>1.8</java.version>
                <springfox.version>2.9.2</springfox.version>
                <!-- Set by Jenkins -->
                <build.number>0</build.number>
@@ -95,9 +94,28 @@ limitations under the License.
                        <artifactId>spring-boot-starter-test</artifactId>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>org.junit.jupiter</groupId>
+                       <artifactId>junit-jupiter-api</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.junit.jupiter</groupId>
+                       <artifactId>junit-jupiter-engine</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.junit.platform</groupId>
+                       <artifactId>junit-platform-launcher</artifactId>
+                       <scope>test</scope>
+               </dependency>
        </dependencies>
        <build>
                <plugins>
+                       <plugin>
+                               <groupId>org.springframework.boot</groupId>
+                               <artifactId>spring-boot-maven-plugin</artifactId>
+                       </plugin>
                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>license-maven-plugin</artifactId>
@@ -119,20 +137,6 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
-                       <plugin>
-                               <groupId>org.springframework.boot</groupId>
-                               <artifactId>spring-boot-maven-plugin</artifactId>
-                       </plugin>
-                       <!-- Require Java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <!-- Spring sets the <version></version> -->
-                               <configuration>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                       </plugin>
                        <!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
                                packaging process that makes access to the original Manifest.MF very difficult. 
                                However, Java provides access to the implementation version for a package, 
@@ -182,6 +186,26 @@ limitations under the License.
                                        <skip>true</skip>
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <groupId>org.jacoco</groupId>
+                               <artifactId>jacoco-maven-plugin</artifactId>
+                               <version>0.7.9</version>
+                               <executions>
+                                       <execution>
+                                               <id>default-prepare-agent</id>
+                                               <goals>
+                                                       <goal>prepare-agent</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>default-report</id>
+                                               <phase>prepare-package</phase>
+                                               <goals>
+                                                       <goal>report</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <!-- https://stackoverflow.com/questions/39126226/fabric8-springboot-full-example -->
                        <plugin>
                                <groupId>io.fabric8</groupId>
@@ -195,7 +219,8 @@ limitations under the License.
                                        <images>
                                                <image>
                                                        <!-- Specify a tag to avoid default tag "latest" -->
-                                                       <name>${project.artifactId}:${project.version}</name>
+                                                       <!-- Avoid maven artifact name here -->
+                                                       <name>ric-dashboard:${project.version}</name>
                                                        <build>
                                                                <from>openjdk:8-jre-slim</from>
                                                                <tags>
@@ -212,7 +237,7 @@ limitations under the License.
                                                                </runCmds>
                                                                <cmd>
                                                                        <!-- CDATA prevents Eclipse formatter from breaking line -->
-                                                                       <shell><![CDATA[cd /maven; java -Xms128m -Xmx1024m -Djava.security.egd=file:/dev/./urandom -jar ${project.artifactId}-${project.version}.${project.packaging}]]></shell>
+                                                                       <shell><![CDATA[cd /maven; java -Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom -jar ${project.artifactId}-${project.version}.${project.packaging}]]></shell>
                                                                </cmd>
                                                        </build>
                                                </image>
index 240522b..0c8f4f2 100644 (file)
@@ -20,8 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 import org.oransc.ric.a1med.client.api.A1MediatorApi;
 import org.oransc.ric.a1med.client.invoker.ApiClient;
@@ -48,10 +48,12 @@ public class A1MediatorConfiguration {
        private final String a1medUrl;
 
        @Autowired
-       public A1MediatorConfiguration(@Value("${a1med.url}") final String url) throws MalformedURLException {
-               logger.info("Configuring A1 Mediator at base URL {}", url);
-               new URL(url);
-               this.a1medUrl = url;
+       public A1MediatorConfiguration(@Value("${a1med.url.prefix}") final String urlPrefix, //
+                       @Value("${a1med.url.suffix}") final String urlSuffix) throws URISyntaxException {
+               logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
+               URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
+               a1medUrl = uri.toString();
+               logger.info("Configuring A1 Mediator at URL {}", a1medUrl);
        }
 
        private ApiClient apiClient() {
index 4573ff0..9cffa4b 100644 (file)
@@ -20,8 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 import org.oransc.ric.anrxapp.client.api.HealthApi;
 import org.oransc.ric.anrxapp.client.api.NcrtApi;
@@ -48,10 +48,12 @@ public class AnrXappConfiguration {
        private final String anrXappUrl;
 
        @Autowired
-       public AnrXappConfiguration(@Value("${anrxapp.url}") final String url) throws MalformedURLException {
-               logger.info("Configuring ANR client at base URL {}", url);
-               new URL(url);
-               this.anrXappUrl = url;
+       public AnrXappConfiguration(@Value("${anrxapp.url.prefix}") final String urlPrefix,
+                       @Value("${anrxapp.url.suffix}") final String urlSuffix) throws URISyntaxException {
+               logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
+               URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
+               anrXappUrl = uri.toString();
+               logger.info("Configuring ANR client at URL {}", anrXappUrl);
        }
 
        private ApiClient apiClient() {
index b33aa04..aaf522e 100644 (file)
@@ -54,15 +54,15 @@ public class AnrXappMockConfiguration {
        private final NeighborCellRelationTable ncrt, ncrtNodeB1, ncrtNodeB2, ncrtNodeB3;
        private final GgNodeBTable gNodebTable;
 
-       private static final String gnodeb1 = "001EF5:0045FE50";
-       private static final String gnodeb2 = "001EF6:0045FE51";
-       private static final String gnodeb3 = "001EF7:0045FE52";
+       private static final String GNODEB1 = "001EF5:0045FE50";
+       private static final String GNODEB2 = "001EF6:0045FE51";
+       private static final String GNODEB3 = "001EF7:0045FE52";
 
        public AnrXappMockConfiguration() {
 
                logger.info("Configuring mock ANR xApp client");
                gNodebTable = new GgNodeBTable();
-               gNodebTable.addGNodeBIdsItem(gnodeb1).addGNodeBIdsItem(gnodeb2).addGNodeBIdsItem(gnodeb3);
+               gNodebTable.addGNodeBIdsItem(GNODEB1).addGNodeBIdsItem(GNODEB2).addGNodeBIdsItem(GNODEB3);
                ncrtNodeB1 = new NeighborCellRelationTable();
                ncrtNodeB2 = new NeighborCellRelationTable();
                ncrtNodeB3 = new NeighborCellRelationTable();
@@ -70,18 +70,18 @@ public class AnrXappMockConfiguration {
                String[] neighbors1 = { "1104", "1105", "1106" };
                for (String n : neighbors1)
                        ncrtNodeB1.addNcrtRelationsItem(
-                                       new NeighborCellRelation().servingCellNrcgi(gnodeb1 + ":1100").neighborCellNrpci(n)
-                                                       .neighborCellNrcgi(gnodeb1 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true));
+                                       new NeighborCellRelation().servingCellNrcgi(GNODEB1 + ":1100").neighborCellNrpci(n)
+                                                       .neighborCellNrcgi(GNODEB1 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true));
                String[] neighbors2 = { "1471", "1472", "1473" };
                for (String n : neighbors2)
                        ncrtNodeB2.addNcrtRelationsItem(
-                                       new NeighborCellRelation().servingCellNrcgi(gnodeb2 + ":1400").neighborCellNrpci(n)
-                                                       .neighborCellNrcgi(gnodeb2 + ":" + n).flagNoHo(false).flagNoXn(false).flagNoRemove(false));
+                                       new NeighborCellRelation().servingCellNrcgi(GNODEB2 + ":1400").neighborCellNrpci(n)
+                                                       .neighborCellNrcgi(GNODEB2 + ":" + n).flagNoHo(false).flagNoXn(false).flagNoRemove(false));
                String[] neighbors3 = { "3601", "3601", "3602" };
                for (String n : neighbors3)
                        ncrtNodeB3.addNcrtRelationsItem(
-                                       new NeighborCellRelation().servingCellNrcgi(gnodeb3 + ":3600").neighborCellNrpci(n)
-                                                       .neighborCellNrcgi(gnodeb3 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true));
+                                       new NeighborCellRelation().servingCellNrcgi(GNODEB3 + ":3600").neighborCellNrpci(n)
+                                                       .neighborCellNrcgi(GNODEB3 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true));
                for (NeighborCellRelation ncr : ncrtNodeB1.getNcrtRelations())
                        ncrt.addNcrtRelationsItem(ncr);
                for (NeighborCellRelation ncr : ncrtNodeB2.getNcrtRelations())
@@ -121,9 +121,9 @@ public class AnrXappMockConfiguration {
                // Swagger sends nulls; front end sends empty strings
                when(mockApi.getNcrt((String) isNull(), (String) isNull(), (String) isNull())).thenReturn(ncrt);
                when(mockApi.getNcrt(eq(""), any(String.class), any(String.class))).thenReturn(ncrt);
-               when(mockApi.getNcrt(eq(gnodeb1), any(String.class), any(String.class))).thenReturn(ncrtNodeB1);
-               when(mockApi.getNcrt(eq(gnodeb2), any(String.class), any(String.class))).thenReturn(ncrtNodeB2);
-               when(mockApi.getNcrt(eq(gnodeb3), any(String.class), any(String.class))).thenReturn(ncrtNodeB3);
+               when(mockApi.getNcrt(eq(GNODEB1), any(String.class), any(String.class))).thenReturn(ncrtNodeB1);
+               when(mockApi.getNcrt(eq(GNODEB2), any(String.class), any(String.class))).thenReturn(ncrtNodeB2);
+               when(mockApi.getNcrt(eq(GNODEB3), any(String.class), any(String.class))).thenReturn(ncrtNodeB3);
                doAnswer(i -> {
                        return null;
                }).when(mockApi).deleteNcrt(any(String.class), any(String.class));
index f2ffca6..889a07a 100644 (file)
@@ -20,8 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 import org.oransc.ric.plt.appmgr.client.api.HealthApi;
 import org.oransc.ric.plt.appmgr.client.api.XappApi;
@@ -49,10 +49,12 @@ public class AppManagerConfiguration {
        private final String xappMgrUrl;
 
        @Autowired
-       public AppManagerConfiguration(@Value("${xappmgr.url}") final String url) throws MalformedURLException {
-               logger.info("Configuring xApp Manager at base URL {}", url);
-               new URL(url);
-               this.xappMgrUrl = url;
+       public AppManagerConfiguration(@Value("${appmgr.url.prefix}") final String urlPrefix,
+                       @Value("${appmgr.url.suffix}") final String urlSuffix) throws URISyntaxException {
+               logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
+               URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
+               xappMgrUrl = uri.toString();
+               logger.info("Configuring App Manager at URL {}", xappMgrUrl);
        }
 
        private ApiClient apiClient() {
index 6e791e3..4ea8bff 100644 (file)
@@ -20,8 +20,7 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
 
 import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
 import org.oransc.ric.e2mgr.client.api.NodebApi;
@@ -48,10 +47,12 @@ public class E2ManagerConfiguration {
        private final String e2mgrUrl;
 
        @Autowired
-       public E2ManagerConfiguration(@Value("${e2mgr.url}") final String url) throws MalformedURLException {
-               logger.info("Configuring E2 Manager at base URL {}", url);
-               new URL(url);
-               this.e2mgrUrl = url;
+       public E2ManagerConfiguration(@Value("${e2mgr.url.prefix}") final String urlPrefix,
+                       @Value("${e2mgr.url.suffix}") final String urlSuffix) throws Exception {
+               logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
+               URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
+               e2mgrUrl = uri.toString();
+               logger.info("Configuring E2 Manager at URL {}", e2mgrUrl);
        }
 
        private ApiClient apiClient() {
index 2fa3eeb..a23dc9d 100644 (file)
@@ -58,6 +58,7 @@ public class AcXappController {
        public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/xapp/ac";
        // Endpoints
        public static final String ADMCTRL_METHOD = "/admctrl";
+       public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
 
        // A "control" is an element in the XApp descriptor
        private static final String AC_CONTROL_NAME = "admission_control_policy";
@@ -74,7 +75,7 @@ public class AcXappController {
        }
 
        @ApiOperation(value = "Gets the A1 client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
-       @RequestMapping(value = DashboardConstants.VERSION_METHOD, method = RequestMethod.GET)
+       @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
        public SuccessTransport getA1MediatorClientVersion() {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(A1MediatorApi.class));
        }
index 2f14148..9a785e8 100644 (file)
@@ -47,21 +47,25 @@ public class AdminController {
        public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/admin";
        public static final String USER_METHOD = "user";
        public static final String HEALTH_METHOD = "health";
+       public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
 
        private final DashboardUser[] users;
 
+       private static final String ACTIVE = "Active";
+       private static final String INACTIVE = "Inactive";
+
        public AdminController() {
                // Mock data
                users = new DashboardUser[] { //
-                               new DashboardUser(1, "John", "Doe", "Active"), //
-                               new DashboardUser(2, "Alice", "Nolan", "Active"), //
-                               new DashboardUser(3, "Pierce", "King", "Inactive"), //
-                               new DashboardUser(4, "Paul", "Smith", "Inactive"), //
-                               new DashboardUser(5, "Jack", "Reacher", "Active") };
+                               new DashboardUser(1, "John", "Doe", ACTIVE), //
+                               new DashboardUser(2, "Alice", "Nolan", ACTIVE), //
+                               new DashboardUser(3, "Pierce", "King", INACTIVE), //
+                               new DashboardUser(4, "Paul", "Smith", INACTIVE), //
+                               new DashboardUser(5, "Jack", "Reacher", ACTIVE) };
        }
 
        @ApiOperation(value = "Gets the Dashboard MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
-       @RequestMapping(value = DashboardConstants.VERSION_METHOD, method = RequestMethod.GET)
+       @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
        public SuccessTransport getVersion() {
                logger.debug("getVersion");
                return new SuccessTransport(200,
index e33b355..dbaa5bc 100644 (file)
@@ -64,6 +64,8 @@ public class AnrXappController {
        public static final String HEALTH_READY_METHOD = "/health/ready";
        public static final String GNODEBS_METHOD = "/gnodebs";
        public static final String NCRT_METHOD = "/ncrt";
+       public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
+
        // Path parameters
        public static final String PP_SERVING = "servingcells";
        public static final String PP_NEIGHBOR = "neighborcells";
@@ -88,8 +90,8 @@ public class AnrXappController {
        }
 
        @ApiOperation(value = "Gets the ANR client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
-       @RequestMapping(value = DashboardConstants.VERSION_METHOD, method = RequestMethod.GET)
-       public SuccessTransport getAnrXappClientVersion() {
+       @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+       public SuccessTransport getClientVersion() {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
        }
 
index ddef5b4..579866d 100644 (file)
@@ -71,6 +71,7 @@ public class AppManagerController {
        public static final String CONFIG_METHOD = "/config";
        public static final String XAPPS_METHOD = "/xapps";
        public static final String XAPPS_LIST_METHOD = XAPPS_METHOD + "/list";
+       public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
        // Path parameters
        public static final String PP_XAPP_NAME = "xAppName";
 
@@ -90,8 +91,8 @@ public class AppManagerController {
        }
 
        @ApiOperation(value = "Gets the XApp manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
-       @RequestMapping(value = DashboardConstants.VERSION_METHOD, method = RequestMethod.GET)
-       public SuccessTransport getXappManagerClientVersion() {
+       @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+       public SuccessTransport getClientVersion() {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
        }
 
index 95bcfb4..04162ab 100644 (file)
@@ -1,21 +1,21 @@
 /*-
- * ===============LICENSE_START=======================================================
- * Acumos
- * ===================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
- * ===================================================================================
- * This Acumos software file is distributed by AT&T and Tech Mahindra
- * under the Apache License, Version 2.0 (the "License");
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *  
+ * 
  *      http://www.apache.org/licenses/LICENSE-2.0
- *  
- * This file is distributed on an "AS IS" BASIS,
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * ===============LICENSE_END=========================================================
+ * ========================LICENSE_END===================================
  */
 package org.oransc.ric.portal.dashboard.controller;
 
index 3d52b8c..506911a 100644 (file)
@@ -76,6 +76,7 @@ public class E2ManagerController {
        public static final String RAN_METHOD = "/ran";
        public static final String ENDC_SETUP_METHOD = "/endcSetup";
        public static final String X2_SETUP_METHOD = "/x2Setup";
+       public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
        // Path parameters
        private static final String PP_RANNAME = "ranName";
 
@@ -104,8 +105,8 @@ public class E2ManagerController {
        }
 
        @ApiOperation(value = "Gets the E2 manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
-       @RequestMapping(value = DashboardConstants.VERSION_METHOD, method = RequestMethod.GET)
-       public SuccessTransport getE2ManagerClientVersion() {
+       @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+       public SuccessTransport getClientVersion() {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthCheckApi.class));
        }
 
index 859c913..cd1b304 100644 (file)
@@ -56,7 +56,7 @@ public class SimpleErrorController implements ErrorController {
 
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-       private static final String ERROR_PATH = "/error";
+       public static final String ERROR_PATH = "/error";
        private static final String TRACE = "trace";
        private final ErrorAttributes errorAttributes;
 
index 6911880..db5d5b0 100644 (file)
 server.port = 8080
 
 # A1 Mediator
-a1med.url = http://jar-app-props-default-A1-URL
+a1med.url.prefix = http://jar-app-props-default-A1-URL-prefix
+a1med.url.suffix =
 
 # ANR xApp
-anrxapp.url = http://jar-app-props-default-ANR-URL
+anrxapp.url.prefix = http://jar-app-props-default-ANR-URL-prefix
+anrxapp.url.suffix =
+
+# App Manager
+appmgr.url.prefix = http://jar-app-props-default-Xapp-Mgr-URL
+appmgr.url.suffix = /ric/v1
 
 # E2 Manager
-e2mgr.url = http://jar-app-props-default-E2-URL
+e2mgr.url.prefix = http://jar-app-props-default-E2-URL
+e2mgr.url.suffix = /v1
 # Supply CSV to  mock the get-list API for testing e2mgr in R1;
 # missing key or empty value disables the mock behavior
 # e2mgr.mock.rannames = RANONE, RANTWO
-
-# Xapp Manager
-xappmgr.url = http://jar-app-props-default-Xapp-Mgr-URL
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 import java.util.Map;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,10 +34,10 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
 import org.springframework.boot.test.web.client.TestRestTemplate;
 import org.springframework.boot.web.server.LocalServerPort;
 import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 import org.springframework.web.util.UriComponentsBuilder;
 
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 // Need the fake answers from the backend
 @ActiveProfiles("mock")
@@ -88,9 +89,12 @@ public class AbstractControllerTest {
                return builder.build().encode().toUri();
        }
 
-       // Must have at least one test here
+       // Because I put the annotations on this parent class,
+       // must define at least one test here.
        @Test
        public void contextLoads() {
+               // Silence Sonar warning about missing assertion.
+               Assertions.assertTrue(logger.isWarnEnabled());
                logger.info("Context loads on mock profile");
        }
 
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
@@ -42,7 +42,7 @@ public class AcXappControllerTest extends AbstractControllerTest {
 
        @Test
        public void versionTest() {
-               URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD);
+               URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.VERSION_METHOD);
                logger.info("Invoking {}", uri);
                SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class);
                Assert.assertFalse(st.getData().toString().isEmpty());
@@ -53,7 +53,8 @@ public class AcXappControllerTest extends AbstractControllerTest {
                // Always returns 501; surprised that no exception is thrown.
                URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.ADMCTRL_METHOD);
                logger.info("Invoking {}", uri);
-               restTemplate.getForObject(uri, String.class);
+               ResponseEntity<String> response = restTemplate.exchange(uri, HttpMethod.GET, null, String.class);
+               Assert.assertTrue(response.getStatusCode().is5xxServerError());
        }
 
        @Test
@@ -62,6 +63,7 @@ public class AcXappControllerTest extends AbstractControllerTest {
                JsonNode body = mapper.readTree("{ \"policy\" : true }");
                URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.ADMCTRL_METHOD);
                HttpEntity<JsonNode> entity = new HttpEntity<>(body);
+               logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.PUT, entity, Void.class);
                Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 import java.util.List;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.oransc.ric.portal.dashboard.controller.AdminController;
 import org.oransc.ric.portal.dashboard.model.DashboardUser;
 import org.oransc.ric.portal.dashboard.model.SuccessTransport;
@@ -40,10 +40,10 @@ public class AdminControllerTest extends AbstractControllerTest {
 
        @Test
        public void versionTest() {
-               URI uri = buildUri(null, AdminController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD);
+               URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.VERSION_METHOD);
                logger.info("Invoking {}", uri);
                SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class);
-               Assert.assertFalse(st.getData().toString().isEmpty());
+               Assertions.assertFalse(st.getData().toString().isEmpty());
        }
 
        @Test
@@ -51,7 +51,7 @@ public class AdminControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.HEALTH_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -61,7 +61,7 @@ public class AdminControllerTest extends AbstractControllerTest {
                ResponseEntity<List<DashboardUser>> response = restTemplate.exchange(uri, HttpMethod.GET, null,
                                new ParameterizedTypeReference<List<DashboardUser>>() {
                                });
-               Assert.assertFalse(response.getBody().isEmpty());
+               Assertions.assertFalse(response.getBody().isEmpty());
        }
 
 }
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.oransc.ric.anrxapp.client.model.GgNodeBTable;
 import org.oransc.ric.anrxapp.client.model.NeighborCellRelationMod;
 import org.oransc.ric.anrxapp.client.model.NeighborCellRelationTable;
@@ -41,10 +41,10 @@ public class AnrXappControllerTest extends AbstractControllerTest {
 
        @Test
        public void versionTest() {
-               URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD);
+               URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, AnrXappController.VERSION_METHOD);
                logger.info("Invoking {}", uri);
                SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class);
-               Assert.assertFalse(st.getData().toString().isEmpty());
+               Assertions.assertFalse(st.getData().toString().isEmpty());
        }
 
        @Test
@@ -52,7 +52,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, AnrXappController.HEALTH_ALIVE_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -60,7 +60,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, AnrXappController.HEALTH_READY_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -68,7 +68,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, AnrXappController.GNODEBS_METHOD);
                logger.info("Invoking {}", uri);
                GgNodeBTable list = restTemplate.getForObject(uri, GgNodeBTable.class);
-               Assert.assertFalse(list.getGNodeBIds().isEmpty());
+               Assertions.assertFalse(list.getGNodeBIds().isEmpty());
        }
 
        @Test
@@ -76,7 +76,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AnrXappController.CONTROLLER_PATH, AnrXappController.NCRT_METHOD);
                logger.info("Invoking {}", uri);
                NeighborCellRelationTable table = restTemplate.getForObject(uri, NeighborCellRelationTable.class);
-               Assert.assertFalse(table.getNcrtRelations().isEmpty());
+               Assertions.assertFalse(table.getNcrtRelations().isEmpty());
        }
 
        @Test
@@ -86,7 +86,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                logger.info("Invoking {}", uri);
                HttpEntity<NeighborCellRelationMod> entity = new HttpEntity<>(new NeighborCellRelationMod());
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.PUT, entity, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -95,7 +95,7 @@ public class AnrXappControllerTest extends AbstractControllerTest {
                                AnrXappController.PP_SERVING, "serving", AnrXappController.PP_NEIGHBOR, "neighbor");
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.DELETE, null, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
 }
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.oransc.ric.plt.appmgr.client.model.AllDeployedXapps;
 import org.oransc.ric.plt.appmgr.client.model.AllXappConfig;
 import org.oransc.ric.plt.appmgr.client.model.ConfigMetadata;
@@ -45,10 +45,10 @@ public class AppManagerControllerTest extends AbstractControllerTest {
 
        @Test
        public void versionTest() {
-               URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD);
+               URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.VERSION_METHOD);
                logger.info("Invoking {}", uri);
                SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class);
-               Assert.assertFalse(st.getData().toString().isEmpty());
+               Assertions.assertFalse(st.getData().toString().isEmpty());
        }
 
        @Test
@@ -56,7 +56,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.HEALTH_ALIVE_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -64,7 +64,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.HEALTH_READY_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -72,7 +72,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.XAPPS_LIST_METHOD);
                logger.info("Invoking {}", uri);
                DashboardDeployableXapps apps = restTemplate.getForObject(uri, DashboardDeployableXapps.class);
-               Assert.assertFalse(apps.isEmpty());
+               Assertions.assertFalse(apps.isEmpty());
        }
 
        @Test
@@ -80,7 +80,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.XAPPS_METHOD);
                logger.info("Invoking {}", uri);
                AllDeployedXapps apps = restTemplate.getForObject(uri, AllDeployedXapps.class);
-               Assert.assertFalse(apps.isEmpty());
+               Assertions.assertFalse(apps.isEmpty());
        }
 
        @Test
@@ -88,7 +88,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.XAPPS_METHOD, "app");
                logger.info("Invoking {}", uri);
                Xapp app = restTemplate.getForObject(uri, Xapp.class);
-               Assert.assertFalse(app.getName().isEmpty());
+               Assertions.assertFalse(app.getName().isEmpty());
        }
 
        @Test
@@ -97,7 +97,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                logger.info("Invoking {}", uri);
                XAppInfo info = new XAppInfo();
                Xapp app = restTemplate.postForObject(uri, info, Xapp.class);
-               Assert.assertFalse(app.getName().isEmpty());
+               Assertions.assertFalse(app.getName().isEmpty());
        }
 
        @Test
@@ -105,7 +105,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.XAPPS_METHOD, "app");
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.DELETE, null, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -113,7 +113,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, AppManagerController.CONTROLLER_PATH, AppManagerController.CONFIG_METHOD);
                logger.info("Invoking {}", uri);
                AllXappConfig config = restTemplate.getForObject(uri, AllXappConfig.class);
-               Assert.assertFalse(config.isEmpty());
+               Assertions.assertFalse(config.isEmpty());
        }
 
        @Test
@@ -122,7 +122,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                logger.info("Invoking {}", uri);
                XAppConfig newConfig = new XAppConfig();
                XAppConfig response = restTemplate.postForObject(uri, newConfig, XAppConfig.class);
-               Assert.assertNotNull(response.getConfig());
+               Assertions.assertNotNull(response.getConfig());
        }
 
        @Test
@@ -132,7 +132,7 @@ public class AppManagerControllerTest extends AbstractControllerTest {
                ConfigMetadata delConfig = new ConfigMetadata();
                HttpEntity<ConfigMetadata> entity = new HttpEntity<>(delConfig);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.DELETE, entity, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
 }
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 /**
  * Tests whether the default (not mock) configuration classes run to completion.
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @SpringBootTest
 public class DefaultContextTest {
 
@@ -39,6 +40,8 @@ public class DefaultContextTest {
 
        @Test
        public void contextLoads() {
+               // Silence Sonar warning about missing assertion.
+               Assertions.assertTrue(logger.isWarnEnabled());
                logger.info("Context loads on default profile");
        }
 
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oransc.ric.portal.dashboard;
+package org.oransc.ric.portal.dashboard.test.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
 import java.util.List;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.oransc.ric.e2mgr.client.model.GetNodebResponse;
 import org.oransc.ric.e2mgr.client.model.NodebIdentity;
 import org.oransc.ric.e2mgr.client.model.SetupRequest;
@@ -44,10 +44,10 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
 
        @Test
        public void versionTest() {
-               URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD);
+               URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, E2ManagerController.VERSION_METHOD);
                logger.info("Invoking {}", uri);
                SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class);
-               Assert.assertFalse(st.getData().toString().isEmpty());
+               Assertions.assertFalse(st.getData().toString().isEmpty());
        }
 
        @Test
@@ -55,7 +55,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, E2ManagerController.HEALTH_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.getForEntity(uri, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -65,7 +65,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                ResponseEntity<List<RanDetailsTransport>> response = restTemplate.exchange(uri, HttpMethod.GET, null,
                                new ParameterizedTypeReference<List<RanDetailsTransport>>() {
                                });
-               Assert.assertFalse(response.getBody().isEmpty());
+               Assertions.assertFalse(response.getBody().isEmpty());
        }
 
        @Test
@@ -75,7 +75,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                ResponseEntity<List<NodebIdentity>> response = restTemplate.exchange(uri, HttpMethod.GET, null,
                                new ParameterizedTypeReference<List<NodebIdentity>>() {
                                });
-               Assert.assertFalse(response.getBody().isEmpty());
+               Assertions.assertFalse(response.getBody().isEmpty());
        }
 
        @Test
@@ -83,7 +83,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, E2ManagerController.NODEB_METHOD, "nodeb");
                logger.info("Invoking {}", uri);
                GetNodebResponse response = restTemplate.getForObject(uri, GetNodebResponse.class);
-               Assert.assertNotNull(response.getRanName());
+               Assertions.assertNotNull(response.getRanName());
        }
 
        @Test
@@ -91,7 +91,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, E2ManagerController.NODEB_METHOD);
                logger.info("Invoking {}", uri);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.DELETE, null, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -101,7 +101,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                SetupRequest setup = new SetupRequest();
                HttpEntity<SetupRequest> entity = new HttpEntity<>(setup);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.POST, entity, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
@@ -111,7 +111,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest {
                SetupRequest setup = new SetupRequest();
                HttpEntity<SetupRequest> entity = new HttpEntity<>(setup);
                ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.POST, entity, Void.class);
-               Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+               Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
 }
index 9cf974f..7a0d422 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
        <parent>
                <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.5-SNAPSHOT</version>
+               <version>1.2.0-SNAPSHOT</version>
        </parent>
        <artifactId>ric-dash-fe</artifactId>
        <name>RIC Dashboard Webapp frontend</name>
  */
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { LoginComponent } from './login.component';
+import { MainComponent } from './main.component';
 
-describe('LoginComponent', () => {
-  let component: LoginComponent;
-  let fixture: ComponentFixture<LoginComponent>;
+describe('MainComponent', () => {
+  let component: MainComponent;
+  let fixture: ComponentFixture<MainComponent>;
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ LoginComponent ]
+      declarations: [ MainComponent ]
     })
     .compileComponents();
   }));
 
   beforeEach(() => {
-    fixture = TestBed.createComponent(LoginComponent);
+    fixture = TestBed.createComponent(MainComponent);
     component = fixture.componentInstance;
     fixture.detectChanges();
   });
 import { Component, OnInit } from '@angular/core';
 
 @Component({
-  selector: 'rd-login',
-  templateUrl: './login.component.html',
-  styleUrls: ['./login.component.scss']
+  selector: 'rd-main',
+  templateUrl: './main.component.html',
+  styleUrls: ['./main.component.scss']
 })
-export class LoginComponent implements OnInit {
+export class MainComponent implements OnInit {
 
   constructor() { }
 
index 1c80641..8eab8a7 100644 (file)
@@ -25,13 +25,12 @@ import { AcXappComponent } from './ac-xapp/ac-xapp.component';
 import { AnrXappComponent } from './anr-xapp/anr-xapp.component';
 import { CatalogComponent } from './catalog/catalog.component';
 import { ControlComponent } from './control/control.component';
-import { LoginComponent } from './login/login.component';
+import { MainComponent } from './main/main.component';
 import { StatsComponent } from './stats/stats.component';
 import { UserComponent } from './user/user.component';
 
 const routes: Routes = [
-    {path: '', component: LoginComponent},
-    {path: 'login', component: LoginComponent},
+    {path: '', component: MainComponent},
     {path: 'catalog', component: CatalogComponent},
     {path: 'control', component: ControlComponent},
     {path: 'ac', component: AcXappComponent},
index fb70a4a..4ffaa52 100644 (file)
@@ -53,7 +53,7 @@ import { EditDashboardUserDialogComponent } from './user/edit-dashboard-user-dia
 import { ErrorDialogComponent } from './ui/error-dialog/error-dialog.component';
 import { ErrorDialogService } from './services/ui/error-dialog.service';
 import { FooterComponent } from './footer/footer.component';
-import { LoginComponent } from './login/login.component';
+import { MainComponent } from './main/main.component';
 import { ModalEventComponent } from './ui/modal-event/modal-event.component';
 import { RanControlComponent } from './ran-control/ran-control.component';
 import { RanControlConnectDialogComponent } from './ran-control/ran-connection-dialog.component';
@@ -81,7 +81,7 @@ import { UserComponent } from './user/user.component';
     EditDashboardUserDialogComponent,
     ErrorDialogComponent,
     FooterComponent,
-    LoginComponent,
+    MainComponent,
     ModalEventComponent,
     RanControlComponent,
     RanControlConnectDialogComponent,