feature-file

How to activate spring boot profile with cucumber

那年仲夏 提交于 2019-12-02 07:22:29
问题 I am looking for a nice way to active a spring profile for my cucumber tests. The cucumber tests need to use a stubbed version of a service which is marked with: @Profile("test") @Component class FooServiceStub extends FooService {...} The regular service looks like this: @Profile("prod") @Component class FooService {...} My requirements: Run cucumber tests with mvn: $ mvn test Run cucumber tests in IDE Run cucumber tests on build server No need to use the -Dspring.profiles.active=...