use of okhttp3.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);
}
use of okhttp3.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);
}
use of okhttp3.Response in project sonarqube by SonarSource.
the class HttpHeadersTest method assertCacheInBrowser.
private static void assertCacheInBrowser(Response httpResponse) {
CacheControl cacheControl = httpResponse.cacheControl();
assertThat(cacheControl.mustRevalidate()).isFalse();
assertThat(cacheControl.noCache()).isFalse();
assertThat(cacheControl.noStore()).isFalse();
}
use of okhttp3.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);
}
use of okhttp3.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);
}
Aggregations