• Andy Wilkinson's avatar
    Consider SpringBootTest's web environment in context cache key · bf9d23e5
    Andy Wilkinson authored
    Previously, the web environment configured on `@SpringBootTest` was not
    part of the context cache key. As a result, two test classes that has
    identical configuration other than one using a MOCK web environment and
    the other using a DEFINED_PORT web environment would share a context
    when they should not do so. Classes that use MOCK and RANDOM_PORT were
    not affected as the use of RANDOM_PORT results in a property for the
    port being added to the environment.
    
    This commit adds a new ContextCustomizer, SpringBootTestWebEnvironment,
    that is used to capture the `webEnvironment` from `@SpringBootTest`
    and use it in its hashCode and equals implementations. This fixes the
    problem as all context customizers are evaluated when determing the
    equality of two context cache keys.
    
    Fixes gh-23085
    bf9d23e5
Name
Last commit
Last update
.bomr Loading commit data...
.github Loading commit data...
.mvn Loading commit data...
ci Loading commit data...
eclipse Loading commit data...
git/hooks Loading commit data...
idea Loading commit data...
spring-boot-project Loading commit data...
spring-boot-tests Loading commit data...
src/checkstyle Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
SUPPORT.adoc Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...