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 {
167
167
.id ("query-script" ) // <1>
168
168
.script (s -> s
169
169
.lang ("mustache" )
170
- .source ("{\" query\" :{\" match\" :{\" {{field}}\" :\" {{value}}\" }}}" )
170
+ .source (so -> so . scriptString ( "{\" query\" :{\" match\" :{\" {{field}}\" :\" {{value}}\" }}}" ) )
171
171
));
172
172
//end::search-template-script
173
173
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ public class UnionTests extends ModelTestCase {
43
43
44
44
@ Test
45
45
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
47
47
{
48
48
Script s = Script .of (_1 -> _1
49
- .source ("a script" )
49
+ .source (_2 -> _2 . scriptString ( "a script" ) )
50
50
);
51
51
s = checkJsonRoundtrip (s , "{\" source\" :\" a script\" }" );
52
- assertEquals ("a script" , s .source ());
52
+ assertEquals ("a script" , s .source (). scriptString () );
53
53
}
54
54
55
55
{
@@ -63,7 +63,7 @@ public void testScriptDeserializer() {
63
63
{
64
64
// Test shortcut property
65
65
Script s = fromJson ("\" a script\" " , Script .class );
66
- assertEquals ("a script" , s .source ());
66
+ assertEquals ("a script" , s .source (). scriptString () );
67
67
}
68
68
}
69
69
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public void i0298_runtimeMappings() throws Exception {
98
98
RuntimeField runtimeField = RuntimeField .of (rf -> rf
99
99
.type (RuntimeFieldType .Double )
100
100
.script (Script .of (s -> s
101
- .source ("emit(doc['price'].value * 1.19)" )
101
+ .source (so -> so . scriptString ( "emit(doc['price'].value * 1.19)" ) )
102
102
))
103
103
);
104
104
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public void testTypeWithParent() {
128
128
.withJson (new StringReader (json ))
129
129
);
130
130
131
- assertEquals ("return doc;" , is .source ());
131
+ assertEquals ("return doc;" , is .source (). scriptString () );
132
132
}
133
133
134
134
@ Test
You can’t perform that action at this time.
0 commit comments