Search in sources :

Example 11 with Request

use of oap.http.Request in project oap by oaplatform.

the class PatternCorsPolicyTest method getRequest.

private static Request getRequest(final String origin, final String url) throws UnknownHostException {
    final BasicHttpRequest basicHttpRequest = new BasicHttpRequest("GET", url);
    basicHttpRequest.addHeader("Origin", origin);
    basicHttpRequest.addHeader("Host", "some-host");
    final Context context = new Context("not important", InetAddress.getLocalHost(), "not important");
    return new Request(basicHttpRequest, context);
}
Also used : Context(oap.http.Context) Request(oap.http.Request) BasicHttpRequest(org.apache.http.message.BasicHttpRequest) BasicHttpRequest(org.apache.http.message.BasicHttpRequest)

Aggregations

Request (oap.http.Request)11 Test (org.testng.annotations.Test)7 Context (oap.http.Context)6 Optional (java.util.Optional)5 UUID (java.util.UUID)5 Session (oap.http.Session)5 Reflect (oap.reflect.Reflect)5 Reflection (oap.reflect.Reflection)5 InetAddress (java.net.InetAddress)4 List (java.util.List)4 lombok.val (lombok.val)4 UnknownHostException (java.net.UnknownHostException)3 HttpResponse (oap.http.HttpResponse)3 Protocol (oap.http.Protocol)3 Response (oap.http.Response)3 HttpGet (org.apache.http.client.methods.HttpGet)3 BasicHttpRequest (org.apache.http.message.BasicHttpRequest)3 DateTime (org.joda.time.DateTime)3 Mockito.mock (org.mockito.Mockito.mock)3 Mockito.when (org.mockito.Mockito.when)3