Merge "Increase test coverage of AppStatsManager"
[portal/ric-dashboard.git] / dashboard / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / AdminController.java
index 62e9886..3369f15 100644 (file)
@@ -21,27 +21,24 @@ package org.oransc.ric.portal.dashboard.controller;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.onap.portalsdk.core.restful.domain.EcompUser;
+import org.oransc.ric.portal.dashboard.AppStatsManager;
 import org.oransc.ric.portal.dashboard.DashboardApplication;
 import org.oransc.ric.portal.dashboard.DashboardConstants;
 import org.oransc.ric.portal.dashboard.DashboardUserManager;
-import org.oransc.ric.portal.dashboard.AppStatsManager;
 import org.oransc.ric.portal.dashboard.exception.StatsManagerException;
+import org.oransc.ric.portal.dashboard.model.AppStats;
 import org.oransc.ric.portal.dashboard.model.IDashboardResponse;
-import org.oransc.ric.portal.dashboard.model.StatsDetailsTransport;
 import org.oransc.ric.portal.dashboard.model.RicRegion;
 import org.oransc.ric.portal.dashboard.model.RicRegionList;
 import org.oransc.ric.portal.dashboard.model.RicRegionTransport;
-import org.oransc.ric.portal.dashboard.model.AppStats;
+import org.oransc.ric.portal.dashboard.model.StatsDetailsTransport;
 import org.oransc.ric.portal.dashboard.model.SuccessTransport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.annotation.Secured;
@@ -52,7 +49,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import io.swagger.annotations.ApiOperation;
@@ -75,9 +71,6 @@ public class AdminController {
        public static final String XAPPMETRICS_METHOD = "metrics";
        public static final String STATAPPMETRIC_METHOD = "appmetric";
 
-       @Value("${metrics.url.ml}")
-       private String mlAppMetricsUrl;
-
        @Autowired
        private DashboardUserManager dashboardUserManager;
 
@@ -155,11 +148,10 @@ public class AdminController {
        @PutMapping(DashboardConstants.RIC_INSTANCE_KEY + "/{" + DashboardConstants.RIC_INSTANCE_KEY + "}/"
                        + STATAPPMETRIC_METHOD)
        @Secured({ DashboardConstants.ROLE_ADMIN })
-       public ResponseEntity<String> updateStats(@PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey,
+       public void updateStats(@PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey,
                        @RequestBody StatsDetailsTransport statsSetupRequest) throws StatsManagerException, IOException {
                logger.debug("updateStats for instance {} request {}", instanceKey, statsSetupRequest);
                appStatsManager.updateStats(instanceKey, statsSetupRequest);
-               return ResponseEntity.ok(null);
        }
 
        @ApiOperation(value = "Deletes xApp metric status.")