Search in sources :

Example 26 with Response

use of com.yahoo.vespa.clustercontroller.core.restapiv2.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method start_starts_http_server_and_publishes_URL_in_IPC.

@Test
public void start_starts_http_server_and_publishes_URL_in_IPC() throws Exception {
    Response response = call(underTest.getUrl() + "/pompom?toto=2");
    assertIsPomPomResponse(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 27 with Response

use of com.yahoo.vespa.clustercontroller.core.restapiv2.Response in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_js_provided_by_plugins.

@Test
public void verify_headers_of_js_provided_by_plugins() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/static/uiextensionsplugin/extension.js");
    verifySecurityHeaders(response);
    verifyContentType(response, "application/javascript");
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 28 with Response

use of com.yahoo.vespa.clustercontroller.core.restapiv2.Response in project sonarqube by SonarSource.

the class SsoAuthenticationTest method display_message_in_ui_but_not_in_log_when_unauthorized_exception.

@Test
public void display_message_in_ui_but_not_in_log_when_unauthorized_exception() throws Exception {
    Response response = doCall("invalid login $", null, null, null);
    assertThat(response.code()).isEqualTo(200);
    assertThat(response.request().url().toString()).contains("sessions/unauthorized");
    List<String> logsLines = FileUtils.readLines(orchestrator.getServer().getWebLogs(), UTF_8);
    assertThat(logsLines).doesNotContain("org.sonar.server.exceptions.BadRequestException: Use only letters, numbers, and .-_@ please.");
    USER_RULE.verifyUserDoesNotExist(USER_LOGIN);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 29 with Response

use of com.yahoo.vespa.clustercontroller.core.restapiv2.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 30 with Response

use of com.yahoo.vespa.clustercontroller.core.restapiv2.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)

Aggregations

Response (okhttp3.Response)1083 Request (okhttp3.Request)814 IOException (java.io.IOException)434 Test (org.junit.Test)330 Response (retrofit2.Response)319 Call (okhttp3.Call)236 ResponseBody (okhttp3.ResponseBody)208 OkHttpClient (okhttp3.OkHttpClient)192 ServiceResponse (com.microsoft.rest.ServiceResponse)179 RequestBody (okhttp3.RequestBody)128 Observable (rx.Observable)116 Callback (okhttp3.Callback)111 MockResponse (okhttp3.mockwebserver.MockResponse)93 List (java.util.List)89 HttpUrl (okhttp3.HttpUrl)81 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)72 TypeToken (com.google.common.reflect.TypeToken)71 ArrayList (java.util.ArrayList)71 File (java.io.File)70 JSONObject (org.json.JSONObject)65