Make assertions based on Annotation#toString() lenient
The behavior for the toString() implementation for annotations changed in JDK 19, per my request to the JDK team (see link below). Specifically, since JDK 19, the toString() implementation for annotation proxies created by the JDK started using canonical names instead of binary names for types. See https://bugs.openjdk.org/browse/JDK-8281462
This commit is contained in:
@@ -289,8 +289,8 @@ class RequestMappingHandlerMappingTests {
|
||||
.isThrownBy(() -> mapping.getMappingForMethod(method, controllerClass))
|
||||
.withMessageContainingAll(
|
||||
"Multiple @HttpExchange annotations found on " + controllerClass,
|
||||
"@" + HttpExchange.class.getName(),
|
||||
"@" + ExtraHttpExchange.class.getName()
|
||||
HttpExchange.class.getSimpleName(),
|
||||
ExtraHttpExchange.class.getSimpleName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -305,8 +305,8 @@ class RequestMappingHandlerMappingTests {
|
||||
.isThrownBy(() -> mapping.getMappingForMethod(method, controllerClass))
|
||||
.withMessageContainingAll(
|
||||
"Multiple @HttpExchange annotations found on " + method,
|
||||
"@" + PostExchange.class.getName(),
|
||||
"@" + PutExchange.class.getName()
|
||||
PostExchange.class.getSimpleName(),
|
||||
PutExchange.class.getSimpleName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -322,8 +322,8 @@ class RequestMappingHandlerMappingTests {
|
||||
.withMessageContainingAll(
|
||||
controllerClass.getName(),
|
||||
"is annotated with @RequestMapping and @HttpExchange annotations, but only one is allowed:",
|
||||
"@" + RequestMapping.class.getName(),
|
||||
"@" + HttpExchange.class.getName()
|
||||
RequestMapping.class.getSimpleName(),
|
||||
HttpExchange.class.getSimpleName()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -339,8 +339,8 @@ class RequestMappingHandlerMappingTests {
|
||||
.withMessageContainingAll(
|
||||
method.toString(),
|
||||
"is annotated with @RequestMapping and @HttpExchange annotations, but only one is allowed:",
|
||||
"@" + PostMapping.class.getName(),
|
||||
"@" + PostExchange.class.getName()
|
||||
PostMapping.class.getSimpleName(),
|
||||
PostExchange.class.getSimpleName()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user