X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Frestclient%2FTestBabelServiceClient.java;h=19e35cad2958e1adcdb19ac1a6eaab2dae30f8ff;hb=598c2469a004c50a1b29882e02e2fab7a8407d8b;hp=c6532448cf8e11e44fe5c1ba00d8b520b0e3588c;hpb=19f034b2554895285f12979b0f36c1629f9af984;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 c653244..19e35ca 100644 --- a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java @@ -69,7 +69,7 @@ public class TestBabelServiceClient { response.add(new BabelArtifact("", null, "")); responseBody = new Gson().toJson(response); - server = new Server(8080); + server = new Server(0); server.setHandler(getMockHandler()); server.start(); } @@ -81,13 +81,14 @@ public class TestBabelServiceClient { @Test public void testRestClient() throws BabelServiceClientException, IOException, URISyntaxException { + String url = server.getURI().toString(); Properties configProperties = new Properties(); configProperties.put("ml.babel.KEYSTORE_PASSWORD", "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0"); configProperties.put("ml.babel.KEYSTORE_FILE", "src/test/resources/auth/aai-client-dummy.p12"); configProperties.put("ml.babel.TRUSTSTORE_PASSWORD", "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0"); // In a real deployment this would be a different file (to the client keystore) configProperties.put("ml.babel.TRUSTSTORE_FILE", "src/test/resources/auth/aai-client-dummy.p12"); - configProperties.put("ml.babel.BASE_URL", "http://localhost:8080/"); + configProperties.put("ml.babel.BASE_URL", url); configProperties.put("ml.babel.GENERATE_ARTIFACTS_URL", "generate"); BabelServiceClient client = new HttpsBabelServiceClientFactory().create(new ModelLoaderConfig(configProperties, ".")); @@ -99,10 +100,13 @@ public class TestBabelServiceClient { @Test public void testRestClientHttp() throws BabelServiceClientException, IOException, URISyntaxException { + String url = server.getURI().toString(); Properties configProperties = new Properties(); configProperties.put("ml.babel.USE_HTTPS", "false"); - configProperties.put("ml.babel.BASE_URL", "http://localhost:8080/"); + configProperties.put("ml.babel.BASE_URL", url); configProperties.put("ml.babel.GENERATE_ARTIFACTS_URL", "generate"); + configProperties.put("ml.aai.RESTCLIENT_CONNECT_TIMEOUT", "3000"); + configProperties.put("ml.aai.RESTCLIENT_READ_TIMEOUT", "3000"); BabelServiceClient client = new HttpsBabelServiceClientFactory().create(new ModelLoaderConfig(configProperties, ".")); List result =