Adding AAI ESR endpoints
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / aai-simulator / src / test / java / org / onap / so / aaisimulator / utils / TestUtils.java
index fecfd85..033db17 100644 (file)
@@ -26,6 +26,7 @@ import java.util.Base64;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
+import org.springframework.web.util.UriComponentsBuilder;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
 
@@ -33,7 +34,6 @@ import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
  * @author waqas.ikram@ericsson.com
  *
  */
-
 public class TestUtils {
 
     private static final String PASSWORD = "aai.onap.org:demo123456!";
@@ -68,6 +68,115 @@ public class TestUtils {
         return "https://localhost:" + port;
     }
 
+    public static String getCustomer() throws Exception, IOException {
+        return getJsonString("test-data/business-customer.json");
+    }
+
+    public static String getServiceSubscription() throws IOException {
+        return getJsonString("test-data/service-subscription.json");
+    }
+
+    public static String getServiceInstance() throws IOException {
+        return getJsonString("test-data/service-instance.json");
+    }
+
+    public static String getGenericVnf() throws IOException {
+        return getJsonString("test-data/generic-vnf.json");
+    }
+
+    public static String getRelationShip() throws IOException {
+        return getJsonString("test-data/relation-ship.json");
+    }
+
+    public static String getPlatformRelatedLink() throws IOException {
+        return getJsonString("test-data/platform-related-link.json");
+    }
+
+    public static String getLineOfBusinessRelatedLink() throws IOException {
+        return getJsonString("test-data/line-of-business-related-link.json");
+    }
+
+    public static String getPlatform() throws IOException {
+        return getJsonString("test-data/platform.json");
+    }
+
+    public static String getGenericVnfRelationShip() throws IOException {
+        return getJsonString("test-data/generic-vnf-relationship.json");
+    }
+
+    public static String getLineOfBusiness() throws IOException {
+        return getJsonString("test-data/line-of-business.json");
+    }
+
+    public static String getBusinessProject() throws IOException {
+        return getJsonString("test-data/business-project.json");
+    }
+
+    public static String getBusinessProjectRelationship() throws IOException {
+        return getJsonString("test-data/business-project-relation-ship.json");
+    }
+
+    public static String getOwningEntityRelationship() throws IOException {
+        return getJsonString("test-data/owning-entity-relation-ship.json");
+    }
+
+    public static String getOwningEntity() throws IOException {
+        return getJsonString("test-data/owning-entity.json");
+    }
+
+    public static String getOrchStatuUpdateServiceInstance() throws IOException {
+        return getJsonString("test-data/service-instance-orch-status-update.json");
+    }
+
+    public static String getRelationShipJsonObject() throws IOException {
+        return getJsonString("test-data/service-Instance-relationShip.json");
+    }
+
+    public static String getCloudRegion() throws IOException {
+        return getJsonString("test-data/cloud-region.json");
+    }
+
+    public static String getTenant() throws IOException {
+        return getJsonString("test-data/tenant.json");
+    }
+
+    public static String getCloudRegionRelatedLink() throws IOException {
+        return getJsonString("test-data/cloud-region-related-link.json");
+    }
+
+    public static String getGenericVnfRelatedLink() throws IOException {
+        return getJsonString("test-data/generic-vnf-related-link.json");
+    }
+
+    public static String getTenantRelationShip() throws IOException {
+        return getJsonString("test-data/tenant-relationship.json");
+    }
+
+    public static String getGenericVnfOrchStatuUpdate() throws IOException {
+        return getJsonString("test-data/generic-vnf-orch-status-update.json");
+    }
+
+    public static String getEsrVnfm() throws IOException {
+        return getJsonString("test-data/esr-vnfm.json");
+    }
+
+    public static String getEsrSystemInfo() throws IOException {
+        return getJsonString("test-data/esr-system-info.json");
+    }
+
+    public static String getVserver() throws IOException {
+        return getJsonString("test-data/vServer.json");
+    }
+
+
+    public static String getUrl(final int port, final String... urls) {
+        final UriComponentsBuilder baseUri = UriComponentsBuilder.fromUriString("https://localhost:" + port);
+        for (final String url : urls) {
+            baseUri.path(url);
+        }
+        return baseUri.toUriString();
+    }
+
     private TestUtils() {}
 
 }