Use BeanFactory to get type produced by a FactoryBean for Bean Overrides
Previously, we only looked at the OBJECT_TYPE_ATTRIBUTE on a FactoryBean's bean definition; however this does not work for situations where the information is provided by the definition's target type rather than the attribute. Rather than manually considering the target type in addition to the existing consideration of the attribute, we now ask the BeanFactory for the type that will be produced by the FactoryBean instead. See https://github.com/spring-projects/spring-boot/issues/40234 Closes gh-33811 Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.test.context.bean.override.mockito.integration;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.MockingDetails;
|
||||
|
||||
@@ -48,7 +47,6 @@ import static org.mockito.Mockito.mockingDetails;
|
||||
* @see MockitoSpyBeanWithGenericsOnTestFieldForExistingGenericBeanIntegrationTests
|
||||
*/
|
||||
@SpringJUnitConfig
|
||||
@Disabled("Disabled until https://github.com/spring-projects/spring-boot/issues/40234 is ported to Spring Framework")
|
||||
class MockitoSpyBeanWithGenericsOnTestFieldForExistingGenericBeanProducedByFactoryBeanIntegrationTests {
|
||||
|
||||
@MockitoSpyBean("exampleService")
|
||||
|
||||
Reference in New Issue
Block a user