DATAES-224 retain newlines when reading mapping/setting files
Fixed test-settings yaml
This commit is contained in:
@@ -2006,6 +2006,25 @@ public class ElasticsearchTemplateTests {
|
||||
assertThat(setting.get("index.number_of_replicas"), Matchers.<Object>is("1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReadFileFromClasspathRetainingNewlines() {
|
||||
// given
|
||||
String settingsFile = "/settings/test-settings.yml";
|
||||
|
||||
// when
|
||||
String content = ElasticsearchTemplate.readFileFromClasspath(settingsFile);
|
||||
|
||||
// then
|
||||
assertThat(content, is("index:\n" +
|
||||
" number_of_shards: 1\n" +
|
||||
" number_of_replicas: 0\n" +
|
||||
" analysis:\n" +
|
||||
" analyzer:\n" +
|
||||
" emailAnalyzer:\n" +
|
||||
" type: custom\n" +
|
||||
" tokenizer: uax_url_email\n"));
|
||||
}
|
||||
|
||||
private IndexQuery getIndexQuery(SampleEntity sampleEntity) {
|
||||
return new IndexQueryBuilder().withId(sampleEntity.getId()).withObject(sampleEntity).build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user