diff options
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/test/java')
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index ec9ad8c29c..e249285867 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -20,9 +20,15 @@ package org.onap.so.db.catalog.client; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + import java.util.List; import java.util.UUID; +import javax.ws.rs.core.UriBuilder; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -44,25 +50,31 @@ import org.onap.so.db.catalog.beans.VnfComponentsRecipe; import org.onap.so.db.catalog.beans.VnfRecipe; import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.ExternalServiceToInternalService; +import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import com.fasterxml.jackson.databind.ObjectMapper; + @RunWith(SpringRunner.class) @SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class CatalogDbClientTest { public static final String MTN13 = "mtn13"; + @LocalServerPort private int port; @Value("${mso.db.auth}") private String msoAdaptersAuth; - + @Autowired CatalogDbClientPortChanger client; @@ -446,6 +458,21 @@ public class CatalogDbClientTest { } @Test + public void testGetNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(){ + NorthBoundRequest northBoundRequest = new NorthBoundRequest(); + northBoundRequest.setAction("createService"); + northBoundRequest.setRequestScope("service"); + northBoundRequest.setIsAlacarte(true); + northBoundRequest.setCloudOwner("my-custom-cloud-owner"); + client.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("createService", "service", true, "my-custom-cloud-owner"); + Assert.assertNotNull(northBoundRequest); + Assert.assertEquals("createService",northBoundRequest.getAction()); + Assert.assertEquals("service",northBoundRequest.getRequestScope()); + Assert.assertEquals(true,northBoundRequest.getIsAlacarte() ); + Assert.assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner()); + } + + @Test public void testFindServiceRecipeByActionAndServiceModelUUID() { ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("createInstance","4694a55f-58b3-4f17-92a5-796d6f5ffd0d" ); Assert.assertNotNull(serviceRecipe); |