Add RIC instance list and controller method
[portal/ric-dashboard.git] / webapp-backend / src / test / java / org / oransc / ric / portal / dashboard / controller / AdminControllerTest.java
index 604a071..f1c2680 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,9 +27,10 @@ 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.InstanceTransport;
 import org.oransc.ric.portal.dashboard.model.SuccessTransport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -57,12 +58,22 @@ public class AdminControllerTest extends AbstractControllerTest {
                Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
        }
 
+       @Test
+       public void getInstancesTest() {
+               URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.INSTANCE_METHOD);
+               logger.info("Invoking {}", uri);
+               ResponseEntity<List<InstanceTransport>> response = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET,
+                               null, new ParameterizedTypeReference<List<InstanceTransport>>() {
+                               });
+               Assertions.assertFalse(response.getBody().isEmpty());
+       }
+
        @Test
        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());
        }