Skip to content

@SpringBootTest does not work when @ActiveProfiles contains a comma #19537

@wujek-srujek

Description

@wujek-srujek

When I define the active profiles like this:

@ActiveProfiles("a,b")

on a Spring Boot Test (noticed on a @WebMvcTest), the correct profiles are still applied. This is because of

TestPropertyValues.of("spring.profiles.active=" + StringUtils.arrayToCommaDelimitedString(profiles))

I'm reporting this because it actually confused the hell out of me while I was introducing a newbie to Spring (Boot) and testing support etc. I'm actually not sure whether this is supposed to work like this or not, seems to be an unknown side effect, and I'm not sure whether this is really an issue. This would not work, for instance, if there were a profile with a comma in its name - but no idea if this is allowed either.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions