package org.asynchttpclient; import static org.junit.Assert.*; import org.asynchttpclient.AsyncHttpClient.BoundRequestBuilder; import org.junit.Test; public class TestAsyncHttpClient { @Test public void testConstructor() { AsyncHttpClient client = new AsyncHttpClient(); assertNotNull(client); } @Test public void testClose() { AsyncHttpClient client = new AsyncHttpClient(); assertFalse(client.isClosed()); client.close(); assertTrue(client.isClosed()); } @Test public void testPrepareConnect() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.prepareConnect(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPrepareDelete() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.prepareDelete(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPrepareGet() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.prepareGet(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPrepareHead() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.prepareHead(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPrepareOptions() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.prepareOptions(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPreparePatch() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.preparePatch(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPreparePost() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.preparePost(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPreparePut() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.preparePut(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } @Test public void testPrepareTrace() { AsyncHttpClient client = new AsyncHttpClient(); String url = "http://www.google.com"; BoundRequestBuilder prepareConnect = client.preparePatch(url); assertTrue(url.equals(prepareConnect.baseURL)); client.close(); } }