Updating image version and fixing tests
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / sdc-simulator / src / main / java / org / onap / so / sdcsimulator / controller / CatalogController.java
index e9f1776..eff63b8 100644 (file)
@@ -28,16 +28,16 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @author Waqas Ikram (waqas.ikram@est.tech)
  *
  */
-@RestController
+@Controller
 @RequestMapping(path = CATALOG_URL)
 public class CatalogController {
     private static final Logger LOGGER = LoggerFactory.getLogger(CatalogController.class);
@@ -49,6 +49,12 @@ public class CatalogController {
         this.resourceProvider = resourceProvider;
     }
 
+    @GetMapping(value = "/resources", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+    public ResponseEntity<?> getResources() {
+        LOGGER.info("Running getResources ...");
+        return ResponseEntity.ok().body(resourceProvider.getResource());
+    }
+
     @GetMapping(value = "/resources/{csarId}/toscaModel", produces = MediaType.APPLICATION_OCTET_STREAM)
     public ResponseEntity<byte[]> getCsar(@PathVariable("csarId") final String csarId) {
         LOGGER.info("Running getCsar for {} ...", csarId);