diff options
author | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-20 11:19:03 +0100 |
---|---|---|
committer | Denes Nemeth <denes.nemeth@nokia.com> | 2018-03-20 16:07:45 +0100 |
commit | 16352314819e03143e91d76b3157a125d3e49f8d (patch) | |
tree | 1aa8432c06aa017304feef11bdfacd506bd097f9 /nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java | |
parent | eabd611557229b92fdf0f84da9628e5a72801dc3 (diff) |
Add spring security to mitigate cve-2017-4995
Change-Id: Iad2a48353e3cd0eb79daa10b0f274c83c89f3c93
Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com>
Issue-ID: VFC-728
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java')
-rw-r--r-- | nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java index 9881749e..45f694ea 100644 --- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java +++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcRestApiProvider.java @@ -47,6 +47,18 @@ public class TestVfcRestApiProvider extends TestBase { } /** + * the / is added to the base URL + */ + @Test + public void testNsLcmApiMissingSlash() throws Exception { + when(msbApiProvider.getMicroServiceUrl(VfcRestApiProvider.NSLCM_API_SERVICE_NAME, VfcRestApiProvider.NSLCM_API_VERION)).thenReturn("http://1.2.3.4:1234/nslcm/v1/lead"); + //when + org.onap.vnfmdriver.ApiClient apiClient = vfcRestApiProvider.buildNslcmApiClient(); + //verify + assertEquals("http://1.2.3.4:1234/lead/", apiClient.getAdapterBuilder().build().baseUrl().toString()); + } + + /** * the base URL of the Catalog API is set */ @Test @@ -58,6 +70,21 @@ public class TestVfcRestApiProvider extends TestBase { assertEquals("http://1.2.3.4:1234/lead/", apiClient.getAdapterBuilder().build().baseUrl().toString()); } + /** + * test / is added to the end of the base URL if missing + */ + @Test + public void testMissingSlash() throws Exception { + when(msbApiProvider.getMicroServiceUrl(VfcRestApiProvider.NSCATALOG_SERVICE_NAME, VfcRestApiProvider.NSCATALOG_API_VERSION)).thenReturn("http://1.2.3.4:1234/lead"); + //when + ApiClient apiClient = vfcRestApiProvider.buildCatalogApiClient(); + //verify + assertEquals("http://1.2.3.4:1234/lead/", apiClient.getAdapterBuilder().build().baseUrl().toString()); + } + + /** + * test NS LCM API is wrapped + */ @Test public void testNsLcm() { when(msbApiProvider.getMicroServiceUrl(VfcRestApiProvider.NSLCM_API_SERVICE_NAME, VfcRestApiProvider.NSLCM_API_VERION)).thenReturn("http://1.2.3.4:1234/nslcm/v1/lead/"); @@ -66,6 +93,9 @@ public class TestVfcRestApiProvider extends TestBase { assertNotNull(vfcRestApiProvider.getNsLcmApi()); } + /** + * test NS catalog API is wrapped + */ @Test public void testNsCatalog() { when(msbApiProvider.getMicroServiceUrl(VfcRestApiProvider.NSCATALOG_SERVICE_NAME, VfcRestApiProvider.NSCATALOG_API_VERSION)).thenReturn("http://1.2.3.4:1234/lead/"); |