diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-08-23 08:55:54 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-08-23 08:58:09 -0400 |
commit | 1dce2e1792763171edad8a5a2afbb0321c189cc7 (patch) | |
tree | 5c42972aa18faf6dfb2b97e297d4accf429d4fb6 /adapters/mso-adapter-utils/src/test/java | |
parent | bb6310f30287b352ad941ecc97aeb278a327d595 (diff) |
Changed RequestFactory for Catalog DB client
- Missed some files, the repository isn't required now that we
dont fetch the identity service directly
- Fixing review comments and removing the unused import
- Fixing the build :) Now that cloudSite has a 1-1 relationship with
cloudidentity, there shouldn't be a need to query the identity on its
own unless the site is missing Refactored some code to use site to
fetch identity as a composition
- Changing the catalogDb client to use
HttpComponentsClientHttpRequestFactory instead of
SimpleClientHttpRequestFactory, the later would lead to a IOException
(FileNotFoundException specifically) whenever a 40X type of a response
code is returned from the spring rest endpoint. Adding some tests for
the catalogDbClient which earlier got missed in handover. Also fixing
another issue with cloudSite repository which was not fetching data
correctly. Fixed a repository which was added initially but later the
same went missing (Not sure how)
Change-Id: I72506865c4c5f7fd07a6031c146a4aba1a96c2c8
Issue-ID: SO-892
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-adapter-utils/src/test/java')
3 files changed, 2 insertions, 22 deletions
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/BaseTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/BaseTest.java index 36a50fd77e..087ac6f17b 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/BaseTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/BaseTest.java @@ -76,7 +76,7 @@ public abstract class BaseTest extends TestDataSetup { .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, "")) .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .withStatus(HttpStatus.SC_OK))); - stubFor(get(urlPathEqualTo("/cloudSite/default")).willReturn(aResponse() + stubFor(get(urlPathEqualTo("/cloudSite/DEFAULT")).willReturn(aResponse() .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, "")) .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON) .withStatus(HttpStatus.SC_OK))); diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java index 012805e774..c3777ca810 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java @@ -74,7 +74,7 @@ public class MsoHeatUtilsRefactorTest extends BaseTest { cloudSite.setIdentityService(identity); - stubFor(get(urlPathEqualTo("/cloudSite/default")).willReturn(aResponse() + stubFor(get(urlPathEqualTo("/cloudSite/DEFAULT")).willReturn(aResponse() .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, "")) .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON) .withStatus(HttpStatus.SC_OK))); diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/CloudConfigTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/CloudConfigTest.java index c6db998b2b..ea25fe580d 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/CloudConfigTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/CloudConfigTest.java @@ -56,26 +56,6 @@ public class CloudConfigTest extends BaseTest{ assertEquals ("3.0", site1.getCloudVersion()); } - - /** - * This method implements a test for the getIdentityServices method. - * @throws MsoException - */ - @Test - public final void testGetIdentityServices () throws MsoException { - - CloudIdentity identity1 = con.getIdentityService("mtn13"); - - assertEquals("m93945", identity1.getMsoId()); - assertEquals("93937EA01B94A10A49279D4572B48369", identity1.getMsoPass()); - assertEquals("admin", identity1.getAdminTenant()); - assertEquals("admin", identity1.getMemberRole()); - assertTrue(identity1.getIdentityUrl().contains("http://localhost:")); - assertEquals(ServerType.KEYSTONE, identity1.getIdentityServerType()); - assertEquals(AuthenticationType.USERNAME_PASSWORD, identity1.getIdentityAuthenticationType()); - - } - /** * This method implements a test for the getCloudSite method. */ |