Search in sources :

Example 11 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_images.

@Test
public void verify_headers_of_images() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/images/logo.svg");
    verifySecurityHeaders(response);
    verifyContentType(response, "image/svg+xml");
    assertCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 12 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_ws.

@Test
public void verify_headers_of_ws() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/api/issues/search");
    verifySecurityHeaders(response);
    verifyContentType(response, "application/json");
    assertNoCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 13 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_css.

@Test
public void verify_headers_of_css() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/css/sonar." + JS_HASH + ".css");
    verifySecurityHeaders(response);
    verifyContentType(response, "text/css");
    assertCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 14 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method return_http_response_with_code_404_and_exception_message_as_body_when_url_has_no_matching_action.

@Test
public void return_http_response_with_code_404_and_exception_message_as_body_when_url_has_no_matching_action() throws IOException {
    String action = "/dfdsfdsfsdsd";
    Response response = call(underTest.getUrl() + action);
    assertThat(response.code()).isEqualTo(404);
    assertThat(response.body().string()).isEqualTo("Error 404, '" + action + "' not found.");
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 15 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method action_is_matched_on_URL_ignoring_case.

@Test
public void action_is_matched_on_URL_ignoring_case() throws IOException {
    Response response = call(underTest.getUrl() + "/pOMpoM");
    assertIsPomPomResponse(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Aggregations

Response (okhttp3.Response)444 Request (okhttp3.Request)320 Test (org.junit.Test)209 IOException (java.io.IOException)158 Response (retrofit2.Response)150 ResponseBody (okhttp3.ResponseBody)128 ServiceResponse (com.microsoft.rest.ServiceResponse)114 Observable (rx.Observable)98 Call (okhttp3.Call)97 MockResponse (okhttp3.mockwebserver.MockResponse)76 RequestBody (okhttp3.RequestBody)65 OkHttpClient (okhttp3.OkHttpClient)60 Callback (okhttp3.Callback)41 List (java.util.List)39 TestClients.clientRequest (keywhiz.TestClients.clientRequest)37 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)32 HttpUrl (okhttp3.HttpUrl)25 ANResponse (com.androidnetworking.common.ANResponse)23 Interceptor (okhttp3.Interceptor)23 MediaType (okhttp3.MediaType)23