use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project sonarqube by SonarSource.
the class ProxyPutMappingRequestBuilderTest method trace_logs.
@Test
public void trace_logs() {
logTester.setLevel(LoggerLevel.TRACE);
PutMappingRequestBuilder requestBuilder = esTester.client().preparePutMapping(FakeIndexDefinition.INDEX).setType(FakeIndexDefinition.TYPE).setSource(mapDomain());
requestBuilder.get();
assertThat(logTester.logs(LoggerLevel.TRACE)).hasSize(1);
}
use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project sonarqube by SonarSource.
the class ProxyPutMappingRequestBuilderTest method put_mapping.
@Test
public void put_mapping() {
PutMappingRequestBuilder requestBuilder = esTester.client().preparePutMapping(FakeIndexDefinition.INDEX).setType(FakeIndexDefinition.TYPE).setSource(mapDomain());
requestBuilder.get();
}
use of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project elasticsearch-opennlp-plugin by spinscale.
the class OpenNlpPluginIntegrationTest method putMapping.
private void putMapping(String mappingFile) throws IOException {
String mapping = copyToStringFromClasspath(mappingFile);
PutMappingRequestBuilder putMappingRequestBuilder = new PutMappingRequestBuilder(node.client().admin().indices());
PutMappingResponse putMappingResponse = putMappingRequestBuilder.setIndices(index).setType(type).setSource(mapping).execute().actionGet();
assertThat(putMappingResponse.isAcknowledged(), is(true));
}
Aggregations