// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpFunctions.java
// @NonNull
// public static Function<HttpRequest, Result<HttpResponse>> httpFunction() {
//   return HTTP_FUNCTION;
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpDeleteRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("DELETE", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpGetRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("GET", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTBodyHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpPostRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("POST", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTBodyHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpPutRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("PUT", url);
// }


import static com.google.android.agera.net.HttpFunctions.httpFunction;
import static com.google.android.agera.net.HttpRequests.httpDeleteRequest;
import static com.google.android.agera.net.HttpRequests.httpGetRequest;
import static com.google.android.agera.net.HttpRequests.httpPostRequest;
import static com.google.android.agera.net.HttpRequests.httpPutRequest;
import static com.google.android.agera.net.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.agera.net;



public final class HttpFunctionsTest {
  private static final String TEST_PROTOCOL = "httptest";
  private static final String TEST_URI = TEST_PROTOCOL + "://path";
  private static final HttpRequest HTTP_GET_REQUEST = httpGetRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_POST_REQUEST = httpPostRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_PUT_REQUEST = httpPutRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_DELETE_REQUEST =
      httpDeleteRequest(TEST_URI).compile();
  private static final byte[] RESPONSE_BODY = new byte[] {2, 3, 4};
  private static final byte[] REQUEST_BODY = new byte[] {1, 2, 3};
  private static final HttpRequest HTTP_GET_REQUEST_WITH_HEADERS = httpGetRequest(TEST_URI)
      .headerField("name", "value").headerField("name2", "value2").compile();
  private static final HttpRequest HTTP_POST_WITH_BODY_REQUEST =
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpFunctions.java
// @NonNull
// public static Function<HttpRequest, Result<HttpResponse>> httpFunction() {
//   return HTTP_FUNCTION;
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpDeleteRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("DELETE", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpGetRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("GET", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTBodyHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpPostRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("POST", url);
// }
// 
// Path: extensions/net/src/main/java/com/google/android/agera/net/HttpRequests.java
// @NonNull
// @SuppressWarnings("unchecked")
// public static HTBodyHeaderFieldRedirectsCachesConnectionTimeoutReadTimeoutCompile
// httpPutRequest(@NonNull final String url) {
//   return new HttpRequestCompiler("PUT", url);
// }


// Path: extensions/net/src/test/java/com/google/android/agera/net/HttpFunctionsTest.java
import static com.google.android.agera.net.HttpFunctions.httpFunction;
import static com.google.android.agera.net.HttpRequests.httpDeleteRequest;
import static com.google.android.agera.net.HttpRequests.httpGetRequest;
import static com.google.android.agera.net.HttpRequests.httpPostRequest;
import static com.google.android.agera.net.HttpRequests.httpPutRequest;
import static com.google.android.agera.net.test.matchers.HasPrivateConstructor.hasPrivateConstructor;
import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;

/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.agera.net;



public final class HttpFunctionsTest {
  private static final String TEST_PROTOCOL = "httptest";
  private static final String TEST_URI = TEST_PROTOCOL + "://path";
  private static final HttpRequest HTTP_GET_REQUEST = httpGetRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_POST_REQUEST = httpPostRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_PUT_REQUEST = httpPutRequest(TEST_URI).compile();
  private static final HttpRequest HTTP_DELETE_REQUEST =
      httpDeleteRequest(TEST_URI).compile();
  private static final byte[] RESPONSE_BODY = new byte[] {2, 3, 4};
  private static final byte[] REQUEST_BODY = new byte[] {1, 2, 3};
  private static final HttpRequest HTTP_GET_REQUEST_WITH_HEADERS = httpGetRequest(TEST_URI)
      .headerField("name", "value").headerField("name2", "value2").compile();
  private static final HttpRequest HTTP_POST_WITH_BODY_REQUEST =
      httpPostRequest(TEST_URI).body(REQUEST_BODY).compile();