• Andy Wilkinson's avatar
    Don’t rely on deduction of main application class when running tests · 4977e48e
    Andy Wilkinson authored
    Previously, when SpringApplicationContextLoader created a
    SpringApplication and used it to load the test’s application context,
    it relied upon SpringApplication correctly deducing the application’s
    main class. This would result in the wrong class being deduced as the
    application’s main method is not called so the test runner’s main method
    would be found instead.
    
    This commit updates SpringApplicationContextLoader to explicitly set
    SpringApplication’s main class to be the current test’s class. While
    not strictly the application’s main class, it is the next best thing
    available in this situation and prevents misleading log messages and
    application versions from being logged.
    
    Fixes gh-2930
    4977e48e
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
spring-boot-versions Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...