Search in sources :

Example 11 with Response

use of retrofit2.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 retrofit2.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 retrofit2.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 retrofit2.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 retrofit2.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)322 Test (org.junit.Test)233 IOException (java.io.IOException)169 Response (retrofit2.Response)150 ResponseBody (okhttp3.ResponseBody)138 ServiceResponse (com.microsoft.rest.ServiceResponse)114 MockResponse (okhttp3.mockwebserver.MockResponse)99 Observable (rx.Observable)99 Call (okhttp3.Call)97 RequestBody (okhttp3.RequestBody)66 OkHttpClient (okhttp3.OkHttpClient)65 Callback (okhttp3.Callback)41 List (java.util.List)40 TestClients.clientRequest (keywhiz.TestClients.clientRequest)37 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)34 HttpUrl (okhttp3.HttpUrl)26 Interceptor (okhttp3.Interceptor)26 Buffer (okio.Buffer)24 ANResponse (com.androidnetworking.common.ANResponse)23