use of org.sonarqube.ws.client.HttpException in project sonarqube by SonarSource.
the class DefaultScannerWsClientTest method create_error_msg_from_html.
@Test
public void create_error_msg_from_html() {
String content = "<!DOCTYPE html><html>something</html>";
assertThat(DefaultScannerWsClient.createErrorMessage(new HttpException("url", 400, content))).isEqualTo("HTTP code 400");
}
use of org.sonarqube.ws.client.HttpException in project sonarqube by SonarSource.
the class DefaultScannerWsClientTest method create_error_msg_from_json.
@Test
public void create_error_msg_from_json() {
String content = "{\"errors\":[{\"msg\":\"missing scan permission\"}, {\"msg\":\"missing another permission\"}]}";
assertThat(DefaultScannerWsClient.createErrorMessage(new HttpException("url", 400, content))).isEqualTo("missing scan permission, missing another permission");
}
Aggregations