@@ -39,17 +39,25 @@ class ProxyHintsTests {
39
39
40
40
41
41
@ Test
42
- void registerJdkProxyWithInterfaceClass () {
43
- this .proxyHints .registerJdkProxy (Function .class );
44
- assertThat (this .proxyHints .jdkProxies ()).singleElement ().satisfies (proxiedInterfaces (Function .class ));
42
+ void registerJdkProxyWithSealedInterface () {
43
+ assertThatIllegalArgumentException ()
44
+ .isThrownBy (() -> this .proxyHints .registerJdkProxy (SealedInterface .class ))
45
+ .withMessageContaining (SealedInterface .class .getName ());
45
46
}
46
47
47
48
@ Test
48
49
void registerJdkProxyWithConcreteClass () {
49
- assertThatIllegalArgumentException ().isThrownBy (() -> this .proxyHints .registerJdkProxy (String .class ))
50
+ assertThatIllegalArgumentException ()
51
+ .isThrownBy (() -> this .proxyHints .registerJdkProxy (String .class ))
50
52
.withMessageContaining (String .class .getName ());
51
53
}
52
54
55
+ @ Test
56
+ void registerJdkProxyWithInterface () {
57
+ this .proxyHints .registerJdkProxy (Function .class );
58
+ assertThat (this .proxyHints .jdkProxies ()).singleElement ().satisfies (proxiedInterfaces (Function .class ));
59
+ }
60
+
53
61
@ Test
54
62
void registerJdkProxyWithTypeReferences () {
55
63
this .proxyHints .registerJdkProxy (TypeReference .of (Function .class ), TypeReference .of ("com.example.Advised" ));
@@ -128,4 +136,11 @@ private static TypeReference[] toTypeReferences(Class<?>... proxiedInterfaces) {
128
136
return Arrays .stream (proxiedInterfaces ).map (TypeReference ::of ).toArray (TypeReference []::new );
129
137
}
130
138
139
+
140
+ sealed interface SealedInterface {
141
+ }
142
+
143
+ static final class SealedClass implements SealedInterface {
144
+ }
145
+
131
146
}
0 commit comments