• Andy Wilkinson's avatar
    Fix Mock|SpyBean context caching · 41954533
    Andy Wilkinson authored
    The fix for gh-20916 updated DefinitionsParser so that the
    ResolvableType for each MockBean or SpyBean field included the
    implementation class from which the field was found. Where the field
    was declared with a variable generic signature that was made constant
    by its implementation class, this allowed the correct concrete type to
    be determined. It also had the unintended side-effect of preventing two
    test classes with identical `@MockBean` and `@SpyBean` configuration
    from sharing a context as the resolvable types for their mock and spy
    bean fields would now be different.
    
    This commit updates DefinitionsParser to only include the
    implementation class in the ResolvableType if the field's generic type
    is variable. For cases where it is not variable, this restores the
    behaviour prior to the fix for gh-20916.
    
    Fixes gh-22566
    41954533
Name
Last commit
Last update
..
java/org/springframework/boot/test Loading commit data...
kotlin/org/springframework/boot/test/web/client Loading commit data...
resources Loading commit data...
webapp Loading commit data...