aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorNiharika Sharma <niharika.sharma@amdocs.com>2022-10-14 14:01:39 -0400
committerNiharika Sharma <niharika.sharma@amdocs.com>2022-10-14 14:01:39 -0400
commitd132185f972de61328bef9d511b875c0eefd9b1c (patch)
tree57193b404f56d81430732083f07688f9253912b9 /src/test/java/org
parent13b9dcf4848fe3df7231c23613d07cd4779f946a (diff)
Fixed AAI ModelLoader fails to connect to aai-babel
Issue-ID: AAI-3533 Signed-off-by: Niharika Sharma <niharika.sharma@amdocs.com> Change-Id: I121263b0be39b13109782e0b5db02d3a36650d75
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java
index 4f99bfc..8da5f89 100644
--- a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java
+++ b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java
@@ -93,6 +93,21 @@ public class TestBabelServiceClient {
assertThat(result.size(), is(equalTo(3)));
}
+ @Test
+ public void testRestClientHttp() throws BabelServiceClientException, IOException, URISyntaxException {
+ Properties configProperties = new Properties();
+ configProperties.put("ml.babel.USE_HTTPS", "false");
+ configProperties.put("ml.babel.BASE_URL", "http://localhost:8080/");
+ configProperties.put("ml.babel.GENERATE_ARTIFACTS_URL", "generate");
+ BabelServiceClient client =
+ new HttpsBabelServiceClientFactory().create(new ModelLoaderConfig(configProperties, "."));
+ List<BabelArtifact> result =
+ client.postArtifact(readBytesFromFile("compressedArtifacts/service-VscpaasTest-csar.csar"),
+ "service-Vscpass-Test", "1.0", "Test-Transaction-ID-BabelClient");
+ assertThat(result.size(), is(equalTo(3)));
+ }
+
+
private byte[] readBytesFromFile(String resourceFile) throws IOException, URISyntaxException {
return Files.readAllBytes(Paths.get(ClassLoader.getSystemResource(resourceFile).toURI()));
}