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:
Sam Brannen
2024-01-23 10:41:40 +01:00
parent 484aee069e
commit 3b2f6e74a6
3 changed files with 20 additions and 20 deletions

View File

@@ -220,8 +220,8 @@ class HttpServiceMethodTests {
.isThrownBy(() -> this.proxyFactory.createClient(serviceInterface))
.withMessageContainingAll(
"Multiple @HttpExchange annotations found on " + serviceInterface,
"@" + HttpExchange.class.getName(),
"@" + ExtraHttpExchange.class.getName()
HttpExchange.class.getSimpleName(),
ExtraHttpExchange.class.getSimpleName()
);
}
@@ -234,8 +234,8 @@ class HttpServiceMethodTests {
.isThrownBy(() -> this.proxyFactory.createClient(serviceInterface))
.withMessageContainingAll(
"Multiple @HttpExchange annotations found on method " + method,
"@" + PostExchange.class.getName(),
"@" + PutExchange.class.getName()
PostExchange.class.getSimpleName(),
PutExchange.class.getSimpleName()
);
}