This commit is contained in:
Stéphane Nicoll
2024-03-18 08:59:22 +01:00
parent 2b56ca08d4
commit 73a1c2d509
9 changed files with 58 additions and 55 deletions

View File

@@ -54,11 +54,11 @@ class JsonLoader {
if (source == null) {
return null;
}
String string = source.toString();
if (string.endsWith(".json")) {
return getJson(new ClassPathResource(string, this.resourceLoadClass));
String jsonSource = source.toString();
if (jsonSource.endsWith(".json")) {
return getJson(new ClassPathResource(jsonSource, this.resourceLoadClass));
}
return string;
return jsonSource;
}
String getJson(Resource source) {

View File

@@ -69,8 +69,9 @@ public class UriAssert extends AbstractStringAssert<UriAssert> {
* assertThat(uri).matchPattern("/orders/*"));
* </code></pre>
* @param uriPattern the pattern that is expected to match
* @see AntPathMatcher
*/
public UriAssert matchesPattern(String uriPattern) {
public UriAssert matchesAntPattern(String uriPattern) {
Assertions.assertThat(pathMatcher.isPattern(uriPattern))
.withFailMessage("'%s' is not an Ant-style path pattern", uriPattern).isTrue();
Assertions.assertThat(pathMatcher.match(uriPattern, this.actual))

View File

@@ -104,7 +104,7 @@ public abstract class AbstractHttpServletRequestAssert<SELF extends AbstractHttp
*/
public SELF hasAsyncStarted(boolean started) {
Assertions.assertThat(this.actual.isAsyncStarted())
.withFailMessage("Async expected %sto have started", (started ? "" : "not "))
.withFailMessage("Async expected %s have started", (started ? "to" : "not to"))
.isEqualTo(started);
return this.myself;
}

View File

@@ -98,7 +98,7 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#getValue() value} is equal to the expected value.
* whose {@linkplain Cookie#getValue() value} is equal to the given one.
* @param name the name of the cookie
* @param expected the expected value of the cookie
*/
@@ -109,7 +109,7 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#getMaxAge() max age} is equal to the expected value.
* whose {@linkplain Cookie#getMaxAge() max age} is equal to the given one.
* @param name the name of the cookie
* @param expected the expected max age of the cookie
*/
@@ -120,7 +120,7 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#getPath() path} is equal to the expected value.
* whose {@linkplain Cookie#getPath() path} is equal to the given one.
* @param name the name of the cookie
* @param expected the expected path of the cookie
*/
@@ -131,7 +131,7 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#getDomain() domain} is equal to the expected value.
* whose {@linkplain Cookie#getDomain() domain} is equal to the given one.
* @param name the name of the cookie
* @param expected the expected domain of the cookie
*/
@@ -142,8 +142,7 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#getSecure() secure flag} is equal to the expected
* value.
* whose {@linkplain Cookie#getSecure() secure flag} is equal to the give one.
* @param name the name of the cookie
* @param expected whether the cookie is secure
*/
@@ -154,8 +153,8 @@ public class CookieMapAssert extends AbstractMapAssert<CookieMapAssert, Map<Stri
/**
* Verify that the actual cookies contain a cookie with the given {@code name}
* whose {@linkplain Cookie#isHttpOnly() http only flag} is equal to the
* expected value.
* whose {@linkplain Cookie#isHttpOnly() http only flag} is equal to the given
* one.
* @param name the name of the cookie
* @param expected whether the cookie is http only
*/