File tree 1 file changed +13
-0
lines changed
java-client/src/test/java/co/elastic/clients/elasticsearch/model
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 29
29
import co .elastic .clients .elasticsearch ._types .query_dsl .Query ;
30
30
import co .elastic .clients .elasticsearch ._types .query_dsl .ShapeQuery ;
31
31
import co .elastic .clients .elasticsearch ._types .query_dsl .TermQuery ;
32
+ import co .elastic .clients .elasticsearch .connector .UpdateIndexNameRequest ;
32
33
import co .elastic .clients .json .JsonData ;
33
34
import co .elastic .clients .testkit .ModelTestCase ;
34
35
import co .elastic .clients .util .MapBuilder ;
@@ -169,4 +170,16 @@ public void testShortcutProperty() {
169
170
assertEquals ("some-field" , q .term ().field ());
170
171
assertEquals ("some-value" , q .term ().value ().stringValue ());
171
172
}
173
+
174
+ @ Test
175
+ public void testWithNull () {
176
+
177
+ String jsonValue = "{\" index_name\" :\" value\" }" ;
178
+ String jsonNull = "{\" index_name\" :null}" ;
179
+ UpdateIndexNameRequest updateValue = UpdateIndexNameRequest .of (u -> u .connectorId ("connector" ).indexName ("value" ));
180
+ UpdateIndexNameRequest updateNull = UpdateIndexNameRequest .of (u -> u .connectorId ("connector" ).indexNameWithNull ());
181
+
182
+ assertEquals (jsonValue ,toJson (updateValue ));
183
+ assertEquals (jsonNull ,toJson (updateNull ));
184
+ }
172
185
}
You can’t perform that action at this time.
0 commit comments