Skip to content

Commit 4d0f172

Browse files
committed
Restore deprecated constructor for binary compatibility support
Code that compiles against the non-deprecated version does not see the new constructor that has been introduced. As such, there is no way for them to migrate to it without resorting to reflection. This commit restores the deprecated constructor so that people can try the latest version more easily. Closes gh-34238
1 parent c85e56a commit 4d0f172

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -82,6 +82,18 @@ public JsonPathExpectationsHelper(String expression, @Nullable Configuration con
8282
this.configuration = (configuration != null) ? configuration : Configuration.defaultConfiguration();
8383
}
8484

85+
/**
86+
* Construct a new {@code JsonPathExpectationsHelper}.
87+
* @param expression the {@link JsonPath} expression; never {@code null} or empty
88+
* @param args arguments to parameterize the {@code JsonPath} expression with,
89+
* using formatting specifiers defined in {@link String#format(String, Object...)}
90+
* @deprecated in favor of calling {@link String#formatted(Object...)} upfront
91+
*/
92+
@Deprecated(since = "6.2", forRemoval = true)
93+
public JsonPathExpectationsHelper(String expression, Object... args) {
94+
this(expression.formatted(args), (Configuration) null);
95+
}
96+
8597

8698
/**
8799
* Evaluate the JSON path expression against the supplied {@code content}

0 commit comments

Comments
 (0)