X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Frestclient%2FTestBabelServiceClient.java;h=8da5f89573db840e13d0c24788aa28566ccfeb3d;hb=c742eb3dcaa8b98a231cdd0a2b9c5c93df69d164;hp=4f99bfc194cc0b36914173dfe850926855cc71ce;hpb=f5eb6ec14630324fe52803bc7a65c684e4ba9192;p=aai%2Fmodel-loader.git 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 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())); }