2626import org .elasticsearch .gradle .VersionProperties ;
2727import org .elasticsearch .gradle .internal .test .rest .transform .RestTestTransform ;
2828import org .elasticsearch .gradle .internal .test .rest .transform .RestTestTransformer ;
29+ import org .elasticsearch .gradle .internal .test .rest .transform .SerializableJsonNode ;
2930import org .elasticsearch .gradle .internal .test .rest .transform .close_to .ReplaceValueInCloseTo ;
3031import org .elasticsearch .gradle .internal .test .rest .transform .do_ .ReplaceKeyInDo ;
3132import org .elasticsearch .gradle .internal .test .rest .transform .headers .InjectHeaders ;
@@ -169,7 +170,7 @@ public void skipTestsByFilePattern(String filePattern, String reason) {
169170 * @param value the value used in the replacement. For example "bar"
170171 */
171172 public void replaceValueInMatch (String subKey , Object value ) {
172- getTransformations ().add (new ReplaceValueInMatch (subKey , MAPPER . convertValue (value , JsonNode .class )));
173+ getTransformations ().add (new ReplaceValueInMatch (subKey , SerializableJsonNode . of (value , JsonNode .class )));
173174 }
174175
175176 /**
@@ -180,7 +181,7 @@ public void replaceValueInMatch(String subKey, Object value) {
180181 * @param testName the testName to apply replacement
181182 */
182183 public void replaceValueInMatch (String subKey , Object value , String testName ) {
183- getTransformations ().add (new ReplaceValueInMatch (subKey , MAPPER . convertValue (value , JsonNode .class ), testName ));
184+ getTransformations ().add (new ReplaceValueInMatch (subKey , SerializableJsonNode . of (value , JsonNode .class ), testName ));
184185 }
185186
186187 /**
@@ -225,7 +226,7 @@ public void replaceKeyInLength(String oldKeyName, String newKeyName) {
225226 * @param value the value used in the replacement. For example 99
226227 */
227228 public void replaceValueInLength (String subKey , int value ) {
228- getTransformations ().add (new ReplaceValueInLength (subKey , MAPPER . convertValue (value , NumericNode .class )));
229+ getTransformations ().add (new ReplaceValueInLength (subKey , SerializableJsonNode . of (value , NumericNode .class )));
229230 }
230231
231232 /**
@@ -237,7 +238,7 @@ public void replaceValueInLength(String subKey, int value) {
237238 * @param testName the testName to apply replacement
238239 */
239240 public void replaceValueInLength (String subKey , int value , String testName ) {
240- getTransformations ().add (new ReplaceValueInLength (subKey , MAPPER . convertValue (value , NumericNode .class ), testName ));
241+ getTransformations ().add (new ReplaceValueInLength (subKey , SerializableJsonNode . of (value , NumericNode .class ), testName ));
241242 }
242243
243244 /**
@@ -260,7 +261,7 @@ public void replaceKeyInMatch(String oldKeyName, String newKeyName) {
260261 * @param testName the testName to apply replacement
261262 */
262263 public void replaceValueInCloseTo (String subKey , double newValue , String testName ) {
263- getTransformations ().add (new ReplaceValueInCloseTo (subKey , MAPPER . convertValue (newValue , NumericNode .class ), testName ));
264+ getTransformations ().add (new ReplaceValueInCloseTo (subKey , SerializableJsonNode . of (newValue , NumericNode .class ), testName ));
264265 }
265266
266267 /**
@@ -271,7 +272,7 @@ public void replaceValueInCloseTo(String subKey, double newValue, String testNam
271272 * @param newValue the value used in the replacement. For example 9.5
272273 */
273274 public void replaceValueInCloseTo (String subKey , double newValue ) {
274- getTransformations ().add (new ReplaceValueInCloseTo (subKey , MAPPER . convertValue (newValue , NumericNode .class )));
275+ getTransformations ().add (new ReplaceValueInCloseTo (subKey , SerializableJsonNode . of (newValue , NumericNode .class )));
275276 }
276277
277278 /**
@@ -282,7 +283,7 @@ public void replaceValueInCloseTo(String subKey, double newValue) {
282283 * @param newValue the value used in the replacement
283284 */
284285 public void replaceIsTrue (String oldValue , Object newValue ) {
285- getTransformations ().add (new ReplaceIsTrue (oldValue , MAPPER . convertValue (newValue , TextNode .class )));
286+ getTransformations ().add (new ReplaceIsTrue (oldValue , SerializableJsonNode . of (newValue , TextNode .class )));
286287 }
287288
288289 /**
@@ -294,7 +295,7 @@ public void replaceIsTrue(String oldValue, Object newValue) {
294295 * @param testName the testName to apply replacement
295296 */
296297 public void replaceIsTrue (String oldValue , Object newValue , String testName ) {
297- getTransformations ().add (new ReplaceIsTrue (oldValue , MAPPER . convertValue (newValue , TextNode .class ), testName ));
298+ getTransformations ().add (new ReplaceIsTrue (oldValue , SerializableJsonNode . of (newValue , TextNode .class ), testName ));
298299 }
299300
300301 /**
@@ -305,7 +306,7 @@ public void replaceIsTrue(String oldValue, Object newValue, String testName) {
305306 * @param newValue the value used in the replacement
306307 */
307308 public void replaceIsFalse (String oldValue , Object newValue ) {
308- getTransformations ().add (new ReplaceIsFalse (oldValue , MAPPER . convertValue (newValue , TextNode .class )));
309+ getTransformations ().add (new ReplaceIsFalse (oldValue , SerializableJsonNode . of (newValue , TextNode .class )));
309310 }
310311
311312 /**
@@ -317,7 +318,7 @@ public void replaceIsFalse(String oldValue, Object newValue) {
317318 * @param testName the testName to apply replacement
318319 */
319320 public void replaceIsFalse (String oldValue , Object newValue , String testName ) {
320- getTransformations ().add (new ReplaceIsFalse (oldValue , MAPPER . convertValue (newValue , TextNode .class ), testName ));
321+ getTransformations ().add (new ReplaceIsFalse (oldValue , SerializableJsonNode . of (newValue , TextNode .class ), testName ));
321322 }
322323
323324 /**
@@ -329,7 +330,7 @@ public void replaceIsFalse(String oldValue, Object newValue, String testName) {
329330 * @param newValue the value used in the replacement
330331 */
331332 public void replaceValueTextByKeyValue (String key , String oldValue , Object newValue ) {
332- getTransformations ().add (new ReplaceTextual (key , oldValue , MAPPER . convertValue (newValue , TextNode .class )));
333+ getTransformations ().add (new ReplaceTextual (key , oldValue , SerializableJsonNode . of (newValue , TextNode .class )));
333334 }
334335
335336 /**
@@ -342,7 +343,7 @@ public void replaceValueTextByKeyValue(String key, String oldValue, Object newVa
342343 * @param testName the testName to apply replacement
343344 */
344345 public void replaceValueTextByKeyValue (String key , String oldValue , Object newValue , String testName ) {
345- getTransformations ().add (new ReplaceTextual (key , oldValue , MAPPER . convertValue (newValue , TextNode .class ), testName ));
346+ getTransformations ().add (new ReplaceTextual (key , oldValue , SerializableJsonNode . of (newValue , TextNode .class ), testName ));
346347 }
347348
348349 /**
@@ -376,7 +377,7 @@ public void removeMatch(String subKey, String testName) {
376377 * @param testName the testName to apply addition
377378 */
378379 public void addMatch (String subKey , Object value , String testName ) {
379- getTransformations ().add (new AddMatch (subKey , MAPPER . convertValue (value , JsonNode .class ), testName ));
380+ getTransformations ().add (new AddMatch (subKey , SerializableJsonNode . of (value , JsonNode .class ), testName ));
380381 }
381382
382383 /**
0 commit comments