Skip to content

Commit

Permalink
fix warning message in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Apr 16, 2024
1 parent de645a1 commit bd3c384
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import static org.hamcrest.Matchers.instanceOf;

public class DynamicFieldMapperTests extends ESSingleNodeTestCase {

@Override
protected Collection<Class<? extends Plugin>> getPlugins() {
return List.of(NonDynamicFieldPlugin.class);
Expand Down Expand Up @@ -204,9 +203,7 @@ protected String contentType() {
}

@Override
protected void parseCreateField(DocumentParserContext context) throws IOException {

}
protected void parseCreateField(DocumentParserContext context) throws IOException {}

@Override
public FieldMapper.Builder getMergeBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,12 @@ public void testDynamicMapperWithBadMapping() throws IOException {
}
b.endArray();
}));
assertWarnings("""
dynamic template [test] has invalid content [{"match_mapping_type":"string","mapping":{"badparam":false}}], \
attempted to validate it with the following match_mapping_type: [string], last error: \
[unknown parameter [badparam] on mapper [__dynamic__test] of type [null]]""");

assertWarnings(
"Parameter [badparam] is used in a dynamic template mapping and has no effect on type [null]. Usage will result in an error in future major versions and should be removed."
);
mapper.parse(source(b -> b.field("field", "foo")));
assertWarnings(
"Parameter [badparam] is used in a dynamic template mapping and has no effect on type [null]. "
+ "Usage will result in an error in future major versions and should be removed."
"Parameter [badparam] is used in a dynamic template mapping and has no effect on type [null]. Usage will result in an error in future major versions and should be removed."
);
}

Expand Down

0 comments on commit bd3c384

Please sign in to comment.