Add license and drop extra WS from tox.ini
[portal/ric-dashboard.git] / webapp-backend / src / test / java / org / oransc / ric / portal / dashboard / controller / AdminControllerTest.java
index 8c61a4e..8e426ad 100644 (file)
@@ -2,7 +2,7 @@
  * ========================LICENSE_START=================================
  * O-RAN-SC
  * %%
- * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * Copyright (C) 2019 AT&T Intellectual Property
  * %%
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,10 +27,9 @@ import java.util.Map;
 
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
 import org.oransc.ric.portal.dashboard.DashboardConstants;
-import org.oransc.ric.portal.dashboard.model.DashboardUser;
 import org.oransc.ric.portal.dashboard.model.ErrorTransport;
-import org.oransc.ric.portal.dashboard.model.IDashboardResponse;
 import org.oransc.ric.portal.dashboard.model.SuccessTransport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -62,8 +61,8 @@ public class AdminControllerTest extends AbstractControllerTest {
        public void getUsersTest() {
                URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.USER_METHOD);
                logger.info("Invoking {}", uri);
-               ResponseEntity<List<DashboardUser>> response = testRestTemplateAdminRole().exchange(uri, HttpMethod.GET, null,
-                               new ParameterizedTypeReference<List<DashboardUser>>() {
+               ResponseEntity<List<EcompUser>> response = testRestTemplateAdminRole().exchange(uri, HttpMethod.GET, null,
+                               new ParameterizedTypeReference<List<EcompUser>>() {
                                });
                Assertions.assertFalse(response.getBody().isEmpty());
        }
@@ -83,21 +82,22 @@ public class AdminControllerTest extends AbstractControllerTest {
                metricsQueryParms.put("app", DashboardConstants.APP_NAME_AC);
                URI uri = buildUri(metricsQueryParms, AdminController.CONTROLLER_PATH, AdminController.XAPPMETRICS_METHOD);
                logger.debug("Invoking {}", uri);
-               ResponseEntity<SuccessTransport> successResponse = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET, null,
-                               SuccessTransport.class);
+               ResponseEntity<SuccessTransport> successResponse = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET,
+                               null, SuccessTransport.class);
                Assertions.assertFalse(successResponse.getBody().getData().toString().isEmpty());
                Assertions.assertTrue(successResponse.getStatusCode().is2xxSuccessful());
        }
 
        @Test
        public void getxAppMetricsUrlTestFail() {
-               Map<String, String> metricsQueryParms = new HashMap<String, String>(); 
-               //Providing a bogus value for application name in query parameter to test failure 
+               Map<String, String> metricsQueryParms = new HashMap<String, String>();
+               // Providing a bogus value for application name in query parameter to test
+               // failure
                metricsQueryParms.put("app", "ABCD");
                URI uri = buildUri(metricsQueryParms, AdminController.CONTROLLER_PATH, AdminController.XAPPMETRICS_METHOD);
                logger.debug("Invoking {}", uri);
-               ResponseEntity<ErrorTransport> errorResponse = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET, null,
-                               ErrorTransport.class);
+               ResponseEntity<ErrorTransport> errorResponse = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET,
+                               null, ErrorTransport.class);
                logger.debug("{}", errorResponse.getBody().getError().toString());
                Assertions.assertTrue(errorResponse.getStatusCode().is4xxClientError());
        }