Skip to content

Commit

Permalink
Spotless misses
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Nov 14, 2023
1 parent 57b8d91 commit 2a9f759
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,19 +500,24 @@ public void testReloadSearchAnalyzers() throws IOException {
);
}

public void testMapperDynamicNotAllowed() {
public void testMapperDynamicNotAllowed() {
final Settings settingsAsTrue = Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1)
.put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), "true")
.build();

final IllegalArgumentException iaeWhenTrue = assertThrows(IllegalArgumentException.class, () -> createIndex("test1", settingsAsTrue).mapperService());
final IllegalArgumentException iaeWhenTrue = assertThrows(
IllegalArgumentException.class,
() -> createIndex("test1", settingsAsTrue).mapperService()
);
assertThat(iaeWhenTrue.getMessage(), equalTo("Setting index.mapper.dynamic was removed after version 6.0.0"));

assertWarnings("[index.mapper.dynamic] setting was deprecated in OpenSearch and will be removed in a future release! See the breaking changes documentation for the next major version.");
assertWarnings(
"[index.mapper.dynamic] setting was deprecated in OpenSearch and will be removed in a future release! See the breaking changes documentation for the next major version."
);
}

public void testMapperDynamicAllowedWhenNullOrFalse() {
final Settings settingsAsNull = Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
Expand All @@ -530,7 +535,9 @@ public void testMapperDynamicAllowedWhenNullOrFalse() {

createIndex("test2", settingsAsFalse).mapperService();

assertWarnings("[index.mapper.dynamic] setting was deprecated in OpenSearch and will be removed in a future release! See the breaking changes documentation for the next major version.");
assertWarnings(
"[index.mapper.dynamic] setting was deprecated in OpenSearch and will be removed in a future release! See the breaking changes documentation for the next major version."
);
}

private boolean assertSameContainedFilters(TokenFilterFactory[] originalTokenFilter, NamedAnalyzer updatedAnalyzer) {
Expand Down

0 comments on commit 2a9f759

Please sign in to comment.