X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Frestclient%2FTestAaiServiceClient.java;h=18753b1f9b5ad9283ac95b0c56a98f16a5bdca35;hb=598c2469a004c50a1b29882e02e2fab7a8407d8b;hp=fd65383b6abe1cc7863f8088766b34d8b0aa1d88;hpb=19f034b2554895285f12979b0f36c1629f9af984;p=aai%2Fmodel-loader.git diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java index fd65383..18753b1 100644 --- a/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiServiceClient.java @@ -53,12 +53,14 @@ public class TestAaiServiceClient { @BeforeEach public void startJetty() throws Exception { - server = new Server(8080); + server = new Server(0); server.setHandler(getMockHandler()); server.start(); Properties props = new Properties(); props.put("ml.aai.KEYSTORE_PASSWORD", "2244"); + props.put("ml.aai.RESTCLIENT_CONNECT_TIMEOUT", "3000"); + props.put("ml.aai.RESTCLIENT_READ_TIMEOUT", "3000"); ModelLoaderConfig config = new ModelLoaderConfig(props, "."); aaiClient = new AaiRestClient(config); } @@ -78,11 +80,11 @@ public class TestAaiServiceClient { @Test public void testOperations() { - String url = "http://localhost:8080"; + String url = server.getURI().toString(); String transId = ""; MediaType mediaType = MediaType.APPLICATION_JSON_TYPE; aaiClient.getResource(url, "", mediaType); - aaiClient.deleteResource("http://localhost", transId, ""); + aaiClient.deleteResource(url, "", transId); aaiClient.getAndDeleteResource(url, transId); aaiClient.postResource(url, "", transId, mediaType); aaiClient.putResource(url, "", transId, mediaType);