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>
# See http://help.github.com/ignore-files/ for more about ignoring files.
+/logs
+
# compiled output
/dist
/tmp
<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>
</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>
</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>
</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>
*/
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;
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());
}
<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>
</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>
</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>
</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>
*/
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;
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());
}
<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>
</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>
</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>
</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>
*/
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;
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());
}
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());
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
<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>
</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>
</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>
*/
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;
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());
}
<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&T Intellectual Property and Nokia</lmp.organization.name>
<lmp.project.name>O-RAN-SC</lmp.project.name>
<lmp.inception.year>2019</lmp.inception.year>
</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>
<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>
<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>
</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,
<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>
<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>
</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>
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;
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() {
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;
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() {
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();
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())
// 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));
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;
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() {
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;
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() {
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";
}
@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));
}
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,
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";
}
@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));
}
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";
}
@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));
}
/*-
- * ===============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;
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";
}
@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));
}
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;
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;
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")
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");
}
* 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;
@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());
// 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
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;
@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
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
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;
@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
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
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
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
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
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
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;
@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
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
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
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
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
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
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
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
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
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
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 {
@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;
@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
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
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
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
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
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
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
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());
}
}
<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() { }
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},
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';
EditDashboardUserDialogComponent,
ErrorDialogComponent,
FooterComponent,
- LoginComponent,
+ MainComponent,
ModalEventComponent,
RanControlComponent,
RanControlConnectDialogComponent,