https://github.com/borisskert/spring-cucumber-profiles
Little project which shows how to test a spring-boot application within different activated profiles with cucumber
https://github.com/borisskert/spring-cucumber-profiles
cucumber spring spring-boot spring-context spring-context-configuration spring-profie spring-profiles
Last synced: 3 months ago
JSON representation
Little project which shows how to test a spring-boot application within different activated profiles with cucumber
- Host: GitHub
- URL: https://github.com/borisskert/spring-cucumber-profiles
- Owner: borisskert
- Created: 2020-04-08T17:42:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T19:16:21.000Z (over 5 years ago)
- Last Synced: 2025-06-26T02:03:04.753Z (3 months ago)
- Topics: cucumber, spring, spring-boot, spring-context, spring-context-configuration, spring-profie, spring-profiles
- Language: Java
- Homepage:
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ~~I need help!~~ Problem SOLVED!
My goal is to run different cucumber step definitions with different spring profiles:
```gherkin
Feature: My FeatureScenario: Get my text with default profile
Given The application is running
And No profile is active
When I ask for my text
Then I should get 'This is default'Scenario: Get my text with debug profile
Given The application is running
Given Profile 'debug' is active
When I ask for my text
Then I should get 'This is for debug'Scenario: Get my text with real profile
Given The application is running
Given Profile 'real' is active
When I ask for my text
Then I should get 'This is for real!'
```The reason is there a several services implementing the interface `MyService`
```java
public interface MyService {
String get();
}
```Each of them only active for its profile:
| class | profile | result |
|-------|---------|--------|
| MyDefaultService | | "This is default" |
| MyRealService | "real" | "This is for real!" |
| MyDebugService | "debug" | "This is for debug" |~~The cucumber tests are failing, the goal is to make them green...~~
~~Thank you in advice.~~Tests are now green - problem solved.