Tighten rules around profile naming
Profiles are only allowed to use dashes, underscores, digits or letters. See gh-43176
This commit is contained in:
committed by
Moritz Halbritter
parent
579be1cea8
commit
0be0bed88c
@@ -60,6 +60,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
* @author Stephane Nicoll
|
||||
* @author Scott Frederick
|
||||
* @author Madhura Bhave
|
||||
* @author Sijun Yang
|
||||
*/
|
||||
class SpringBootContextLoaderTests {
|
||||
|
||||
@@ -127,11 +128,6 @@ class SpringBootContextLoaderTests {
|
||||
assertThat(getActiveProfiles(MultipleActiveProfiles.class)).containsExactly("profile1", "profile2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void activeProfileWithComma() {
|
||||
assertThat(getActiveProfiles(ActiveProfileWithComma.class)).containsExactly("profile1,2");
|
||||
}
|
||||
|
||||
@Test // gh-28776
|
||||
void testPropertyValuesShouldTakePrecedenceWhenInlinedPropertiesPresent() {
|
||||
TestContext context = new ExposedTestContextManager(SimpleConfig.class).getExposedTestContext();
|
||||
@@ -314,14 +310,8 @@ class SpringBootContextLoaderTests {
|
||||
|
||||
}
|
||||
|
||||
@SpringBootTest(classes = Config.class)
|
||||
@ActiveProfiles({ "profile1,2" })
|
||||
static class ActiveProfileWithComma {
|
||||
|
||||
}
|
||||
|
||||
@SpringBootTest(properties = { "key=myValue" }, classes = Config.class)
|
||||
@ActiveProfiles({ "profile1,2" })
|
||||
@ActiveProfiles({ "profile1" })
|
||||
static class ActiveProfileWithInlinedProperties {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user