-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertheme: config-dataIssues related to the configuration themeIssues related to the configuration theme
Description
With version Spring Boot version 2.3.0.RELEASE, tests annotated with @ActiveProfiles("test")
fail to resolve variable spring.profiles.active
.
The issue is not present on version 2.2.7.RELEASE.
It can be reproduced with a simple Spring Boot app created from Spring Initializr with options:
- Maven Project
- Java
- Spring Boot 2.3.0
- Packaging Jar
- Java 8
- No dependencies
The code to add are a Config
class, @ActiveProfiles
on the test class, and a application-test.properties
file (empty contents).
Config class
package com.example.demo;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
@PropertySource(
ignoreResourceNotFound = false,
value = "classpath:application-${spring.profiles.active}.properties")
public class Config {}
Test file with @activeprofiles
@SpringBootTest
@ActiveProfiles("test")
class DemoApplicationTests {
@Test
void contextLoads() {}
}
imtiazShakil, sgc109, karayv and SterlingFBG
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertheme: config-dataIssues related to the configuration themeIssues related to the configuration theme