use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class ViewIndexDefinitionTest method define.
@Test
public void define() {
ViewIndexDefinition def = new ViewIndexDefinition(new MapSettings());
def.define(underTest);
assertThat(underTest.getIndices()).hasSize(1);
NewIndex index = underTest.getIndices().get("views");
assertThat(index).isNotNull();
assertThat(index.getTypes().keySet()).containsOnly("view");
assertThat(index.getSettings().get("index.number_of_shards")).isEqualTo("5");
assertThat(index.getSettings().get("index.number_of_replicas")).isEqualTo("0");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultHttpDownloaderTest method readGzipString.
@Test
public void readGzipString() throws URISyntaxException {
String text = new DefaultHttpDownloader(new MapSettings()).readString(new URI(baseUrl + "/gzip/"), StandardCharsets.UTF_8);
assertThat(text).isEqualTo("GZIP response");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultHttpDownloaderTest method uri_description.
@Test
public void uri_description() throws URISyntaxException {
String description = new DefaultHttpDownloader(new MapSettings()).description(new URI("http://sonarsource.org"));
assertThat(description).matches("http://sonarsource.org \\(.*\\)");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultHttpDownloaderTest method readString.
@Test
public void readString() throws URISyntaxException {
String text = new DefaultHttpDownloader(new MapSettings()).readString(new URI(baseUrl), StandardCharsets.UTF_8);
assertThat(text.length()).isGreaterThan(10);
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultHttpDownloaderTest method downloadToFile.
@Test
public void downloadToFile() throws URISyntaxException, IOException {
File toDir = temporaryFolder.newFolder();
File toFile = new File(toDir, "downloadToFile.txt");
new DefaultHttpDownloader(new MapSettings()).download(new URI(baseUrl), toFile);
assertThat(toFile).exists();
assertThat(toFile.length()).isGreaterThan(10l);
}
Aggregations