Skip to content

Commit

Permalink
Add expected price validation to E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
albertparis committed Sep 16, 2024
1 parent 059a57e commit db94c93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.math.RoundingMode;

import static org.hamcrest.CoreMatchers.is;
import org.hamcrest.MatcherAssert;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.notNullValue;
import org.springframework.boot.test.web.server.LocalServerPort;
Expand Down
13 changes: 7 additions & 6 deletions src/test/resources/features/price_finder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ Feature: Price Finder API
When I request the price for brand <brandId>, product <productId> at "<applicationDate>"
Then the response status code should be <statusCode>
And the response should contain the price details
And the price should be <expectedPrice>

Examples:
| brandId | productId | applicationDate | statusCode |
| 1 | 35455 | 2020-06-14T10:00:00 | 200 |
| 1 | 35455 | 2020-06-14T16:00:00 | 200 |
| 1 | 35455 | 2020-06-14T21:00:00 | 200 |
| 1 | 35455 | 2020-06-15T10:00:00 | 200 |
| 1 | 35455 | 2020-06-16T21:00:00 | 200 |
| brandId | productId | applicationDate | statusCode | expectedPrice |
| 1 | 35455 | 2020-06-14T10:00:00 | 200 | 35.50 |
| 1 | 35455 | 2020-06-14T16:00:00 | 200 | 25.45 |
| 1 | 35455 | 2020-06-14T21:00:00 | 200 | 35.50 |
| 1 | 35455 | 2020-06-15T10:00:00 | 200 | 30.50 |
| 1 | 35455 | 2020-06-16T21:00:00 | 200 | 38.95 |

Scenario: Get price for non-existent product
Given the Price Finder API is available
Expand Down

0 comments on commit db94c93

Please sign in to comment.