# Use the following connection string if you want to use integrated security with Microsoft Sql Server
# Do not set sonar.jdbc.username or sonar.jdbc.password property if you are using Integrated Security
# For Integrated Security to work, you have to download the Microsoft SQL JDBC driver package from
-# http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
+# https://www.microsoft.com/en-us/download/details.aspx?id=55539
# and copy sqljdbc_auth.dll to your path. You have to copy the 32 bit or 64 bit version of the dll
# depending upon the architecture of your server machine.
-# This version of SonarQube has been tested with Microsoft SQL JDBC version 4.1
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true
# Use the following connection string if you want to use SQL Auth while connecting to MS Sql Server.
import com.sonar.orchestrator.Orchestrator;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.HttpHeaders;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.BeforeClass;
RecordedRequest request = server.takeRequest(1, TimeUnit.SECONDS);
assertThat(request.getMethod()).isEqualTo("DELETE");
- assertThat(request.getHeader(HttpHeaders.USER_AGENT)).contains("SonarQube");
+ assertThat(request.getHeader("User-Agent")).contains("SonarQube");
Map<String, Object> json = jsonToMap(request.getBody().readUtf8());
assertThat(json.get("id")).isEqualTo(serverId());
}
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-import javax.ws.rs.core.HttpHeaders;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.After;
RecordedRequest request = telemetryServer.takeRequest();
assertThat(request.getMethod()).isEqualTo("POST");
- assertThat(request.getHeader(HttpHeaders.USER_AGENT)).contains("SonarQube");
+ assertThat(request.getHeader("User-Agent")).contains("SonarQube");
Map<String, Object> json = jsonToMap(request.getBody().readUtf8());
assertThat(json.get("id")).isEqualTo(serverId());
Map<String, String> database = (Map<String, String>) json.get("database");
assertThat(plugins).contains("xoo");
assertThat(getInteger(json.get("ncloc"))).isEqualTo(13 * 2 + 7);
assertThat(getInteger(json.get("lines"))).isEqualTo(17 * 3);
- List<Map<String, String>> projectCountByLanguage = (List<Map<String,String>>) json.get("projectCountByLanguage");
+ List<Map<String, String>> projectCountByLanguage = (List<Map<String, String>>) json.get("projectCountByLanguage");
assertThat(projectCountByLanguage).extracting(p -> p.get("language"), p -> getInteger(p.get("count")))
.contains(tuple("xoo", 2), tuple("xoo2", 1));
- List<Map<String, String>> nclocByLanguage = (List<Map<String,String>>) json.get("nclocByLanguage");
+ List<Map<String, String>> nclocByLanguage = (List<Map<String, String>>) json.get("nclocByLanguage");
assertThat(nclocByLanguage).extracting(p -> p.get("language"), p -> getInteger(p.get("ncloc")))
.contains(tuple("xoo", 13 * 2), tuple("xoo2", 7));
}