Fix imports and pom problem 33/2233/1
authorelinuxhenrik <henrik.b.andersson@est.tech>
Wed, 15 Jan 2020 13:42:41 +0000 (14:42 +0100)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Wed, 15 Jan 2020 13:44:18 +0000 (14:44 +0100)
Change-Id: I52e457372a581cd0900d1c63ce8e617b62558626
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
dashboard/webapp-backend/pom.xml
dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/PolicyController.java
dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApiImpl.java
dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/PortalRestCentralServiceTest.java

index f089180..095abef 100644 (file)
@@ -166,8 +166,6 @@ limitations under the License.
         <dependency>
             <groupId>org.junit.platform</groupId>
             <artifactId>junit-platform-launcher</artifactId>
-            <!-- Override Spring-Boot choice for Eclipse -->
-            <version>1.4.2</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
index 5b90931..e870db0 100644 (file)
@@ -21,26 +21,17 @@ package org.oransc.ric.portal.dashboard.controller;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
-
 import io.swagger.annotations.ApiOperation;
-
 import java.lang.invoke.MethodHandles;
 import java.util.Collection;
-
 import javax.servlet.http.HttpServletResponse;
-
 import org.oransc.ric.portal.dashboard.DashboardConstants;
-import org.oransc.ric.portal.dashboard.exceptions.HttpBadRequestException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpInternalServerErrorException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpNotFoundException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpNotImplementedException;
 import org.oransc.ric.portal.dashboard.model.PolicyInstances;
 import org.oransc.ric.portal.dashboard.model.PolicyTypes;
 import org.oransc.ric.portal.dashboard.policyagentapi.PolicyAgentApi;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.annotation.Secured;
@@ -147,23 +138,6 @@ public class PolicyController {
         this.policyAgentApi.deletePolicy(policyInstanceId);
     }
 
-    private void checkHttpError(String httpCode) {
-        logger.debug("Http Response Code: {}", httpCode);
-        if (httpCode.equals(String.valueOf(HttpStatus.NOT_FOUND.value()))) {
-            logger.error("Caught HttpNotFoundException");
-            throw new HttpNotFoundException("Not Found Exception");
-        } else if (httpCode.equals(String.valueOf(HttpStatus.BAD_REQUEST.value()))) {
-            logger.error("Caught HttpBadRequestException");
-            throw new HttpBadRequestException("Bad Request Exception");
-        } else if (httpCode.equals(String.valueOf(HttpStatus.INTERNAL_SERVER_ERROR.value()))) {
-            logger.error("Caught HttpInternalServerErrorException");
-            throw new HttpInternalServerErrorException("Internal Server Error Exception");
-        } else if (httpCode.equals(String.valueOf(HttpStatus.NOT_IMPLEMENTED.value()))) {
-            logger.error("Caught HttpNotImplementedException");
-            throw new HttpNotImplementedException("Not Implemented Exception");
-        }
-    }
-
     @ApiOperation(value = "Returns the rics supporting the given policy type.")
     @GetMapping("/rics")
     @Secured({DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD})
index af814b9..b80389c 100644 (file)
@@ -25,14 +25,12 @@ import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.google.gson.reflect.TypeToken;
-
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Type;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Vector;
-
 import org.immutables.gson.Gson;
 import org.immutables.value.Value;
 import org.oransc.ric.portal.dashboard.model.ImmutablePolicyInfo;
index 1e8d3a3..eef1726 100644 (file)
@@ -21,21 +21,11 @@ package org.oransc.ric.portal.dashboard.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.URI;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.onap.portalsdk.core.restful.domain.EcompRole;
-import org.onap.portalsdk.core.restful.domain.EcompUser;
-import org.oransc.ric.portal.dashboard.DashboardConstants;
-import org.oransc.ric.portal.dashboard.config.PortalApIMockConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
@@ -63,7 +53,7 @@ public class PortalRestCentralServiceTest extends AbstractControllerTest {
         Assertions.assertTrue(response.getBody().contains("Static error page"));
     }
 
-    private HttpEntity<Object> getEntityWithHeaders(Object body) {
+/*     private HttpEntity<Object> getEntityWithHeaders(Object body) {
         HttpHeaders headers = new HttpHeaders();
         headers.set(PortalApIMockConfiguration.PORTAL_USERNAME_HEADER_KEY,
             PortalApIMockConfiguration.PORTAL_USERNAME_HEADER_KEY);
@@ -86,7 +76,7 @@ public class PortalRestCentralServiceTest extends AbstractControllerTest {
         return user;
     }
 
-    /*
+       @Test
      * @Test
      * public void createUserTest() {
      * final String loginId = "login1";