Replace deprecated methods in model-loader
[aai/model-loader.git] / src / test / java / org / onap / aai / modelloader / restclient / TestAaiServiceClient.java
index 96620ee..c5da065 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
@@ -22,13 +22,17 @@ package org.onap.aai.modelloader.restclient;
 
 import static javax.servlet.http.HttpServletResponse.SC_OK;
 import static org.apache.commons.io.IOUtils.write;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.Properties;
+
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.core.MediaType;
+
 import org.eclipse.jetty.server.Handler;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.Server;
@@ -39,7 +43,7 @@ import org.junit.Test;
 import org.onap.aai.modelloader.config.ModelLoaderConfig;
 
 /**
- * Local testing of the Babel service
+ * Local testing of the A&AI Service client.
  *
  */
 public class TestAaiServiceClient {
@@ -69,11 +73,12 @@ public class TestAaiServiceClient {
         Properties props = new Properties();
         ModelLoaderConfig config = new ModelLoaderConfig(props, ".");
         new AaiRestClient(config);
+        assertTrue(true);
     }
 
     @Test
     public void testOperations() {
-        String url = "http://localhost";
+        String url = "http://localhost:8080";
         String transId = "";
         MediaType mediaType = MediaType.APPLICATION_JSON_TYPE;
         aaiClient.getResource(url, "", mediaType);
@@ -81,6 +86,7 @@ public class TestAaiServiceClient {
         aaiClient.getAndDeleteResource(url, transId);
         aaiClient.postResource(url, "", transId, mediaType);
         aaiClient.putResource(url, "", transId, mediaType);
+        assertTrue(true);
     }
 
 
@@ -96,7 +102,7 @@ public class TestAaiServiceClient {
                     HttpServletResponse response) throws IOException, ServletException {
                 response.setStatus(SC_OK);
                 response.setContentType("text/json;charset=utf-8");
-                write("", response.getOutputStream());
+                write("", response.getOutputStream(), Charset.defaultCharset());
                 request.setHandled(true);
             }
         };