File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
java-client/src/test/java/co/elastic/clients Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ public void searchTemplate() throws Exception {
167167 .id ("query-script" ) // <1>
168168 .script (s -> s
169169 .lang ("mustache" )
170- .source ("{\" query\" :{\" match\" :{\" {{field}}\" :\" {{value}}\" }}}" )
170+ .source (so -> so . scriptString ( "{\" query\" :{\" match\" :{\" {{field}}\" :\" {{value}}\" }}}" ) )
171171 ));
172172 //end::search-template-script
173173
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ public class UnionTests extends ModelTestCase {
4343
4444 @ Test
4545 public void testScriptDeserializer () {
46- // A union discriminated by its field names (source -> inline, id -> stored)
46+ // the source field in script is both a shortcut and an externally tagged union
4747 {
4848 Script s = Script .of (_1 -> _1
49- .source ("a script" )
49+ .source (_2 -> _2 . scriptString ( "a script" ) )
5050 );
5151 s = checkJsonRoundtrip (s , "{\" source\" :\" a script\" }" );
52- assertEquals ("a script" , s .source ());
52+ assertEquals ("a script" , s .source (). scriptString () );
5353 }
5454
5555 {
@@ -63,7 +63,7 @@ public void testScriptDeserializer() {
6363 {
6464 // Test shortcut property
6565 Script s = fromJson ("\" a script\" " , Script .class );
66- assertEquals ("a script" , s .source ());
66+ assertEquals ("a script" , s .source (). scriptString () );
6767 }
6868 }
6969
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public void i0298_runtimeMappings() throws Exception {
9898 RuntimeField runtimeField = RuntimeField .of (rf -> rf
9999 .type (RuntimeFieldType .Double )
100100 .script (Script .of (s -> s
101- .source ("emit(doc['price'].value * 1.19)" )
101+ .source (so -> so . scriptString ( "emit(doc['price'].value * 1.19)" ) )
102102 ))
103103 );
104104
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public void testTypeWithParent() {
128128 .withJson (new StringReader (json ))
129129 );
130130
131- assertEquals ("return doc;" , is .source ());
131+ assertEquals ("return doc;" , is .source (). scriptString () );
132132 }
133133
134134 @ Test
You can’t perform that action at this time.
0 commit comments