Skip to content

ActiveProfiles not used on SpringBootApplication for bootTestRun #47354

@jbeaken

Description

@jbeaken

It would seem that ActiveProfiles isn't detected when on a SpringBootApplication when run as part of bootTestRun

In src/test/java


import org.springframework.test.context.ActiveProfiles;

@ActiveProfiles("generate-schema")
public class RunGenerateSchema {

    public static void main(String[] args) {
        SpringApplication.from(GenerateSchema::main).with(ContainersConfiguration.class).run(args);;
    }
}

output:

16:30:59.051 [main] INFO  c.elsevier.titan.deca.GenerateSchema - No active profile set, falling back to 1 default profile: "default"

Would be very useful if profiles could be set, without having to override args.

this issue #40620 makes sense in a non-test environment, but for test would be handy

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions