Search implemented interfaces on superclass for @ServiceConnection
Refine original fix to also search interfaces on the superclass. Fixes gh-37671
This commit is contained in:
@@ -94,6 +94,14 @@ class ServiceConnectionContextCustomizerFactoryTests {
|
||||
assertThat(customizer.getSources()).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
void createContextCustomizerWhenInheritedImplementedInterfaceHasServiceConnectionsReturnsCustomizer() {
|
||||
ServiceConnectionContextCustomizer customizer = (ServiceConnectionContextCustomizer) this.factory
|
||||
.createContextCustomizer(ServiceConnectionsImplSubclass.class, null);
|
||||
assertThat(customizer).isNotNull();
|
||||
assertThat(customizer.getSources()).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
void createContextCustomizerWhenClassHasNonStaticServiceConnectionFailsWithHelpfulException() {
|
||||
assertThatIllegalStateException()
|
||||
@@ -186,6 +194,10 @@ class ServiceConnectionContextCustomizerFactoryTests {
|
||||
|
||||
}
|
||||
|
||||
static class ServiceConnectionsImplSubclass extends ServiceConnectionsImpl {
|
||||
|
||||
}
|
||||
|
||||
static class NonStaticServiceConnection {
|
||||
|
||||
@ServiceConnection
|
||||
|
||||
Reference in New Issue
Block a user