https://github.com/findinpath/spring-retry-cucumber
Cucumber tests written for spring-retry Github API client
https://github.com/findinpath/spring-retry-cucumber
cucumber-jvm spring-aop spring-boot spring-retry
Last synced: 10 months ago
JSON representation
Cucumber tests written for spring-retry Github API client
- Host: GitHub
- URL: https://github.com/findinpath/spring-retry-cucumber
- Owner: findinpath
- Created: 2019-11-23T16:02:58.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T23:24:54.000Z (about 3 years ago)
- Last Synced: 2025-01-29T18:32:03.222Z (12 months ago)
- Topics: cucumber-jvm, spring-aop, spring-boot, spring-retry
- Language: Java
- Homepage: https://www.findinpath.com/spring-retry-cucumber/
- Size: 274 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Executable test specifications for Spring Retry Beans with Cucumber
===================================================================
This project showcases on how to test [spring-retry](https://github.com/spring-projects/spring-retry)
retryable functionality with [Cucumber](https://github.com/cucumber/cucumber-jvm) library.
The outcome of using [Cucumber](https://cucumber.io/docs) for test purposes
are very easy to read test specifications which empower even non-technical
users to get a good feeling about the expected functionality of the
application.
Below are presented the accuracy & failure test scenarios for a Github API
client with [spring-retry](https://github.com/spring-projects/spring-retry)
configured functionality.


The [spring-retry]([spring-retry](https://github.com/spring-projects/spring-retry))
functionality is added on top of the basic Github API client via
Spring AOP
Check an in-depth article regarding the introduction of metrics
via Spring AOP on the spring-retry functionality here
https://www.findinpath.com/spring-retry-metrics/
For testing, the library [WireMock](http://wiremock.org/) is being used
for being able to mock the Github API.
Check more details on how to browse through the requests reaching WireMock
Server on the blog post: https://www.findinpath.com/wiremock-logged-requests/
[Cucumber Gherkin](https://cucumber.io/docs/gherkin/reference/) grammar rules
used for parsing the executable test specifications are extended in this project
to be able to support custom types:
- `com.github.tomakehurst.wiremock.http.RequestMethod`
- `org.springframework.http.HttpStatus`
See in the images referenced above the highlighted tokens:
- `GET` (corresponds to `RequestMethod.GET`)
- `INTERNAL_SERVER_ERROR` (corresponds to `HttpStatus.INTERNAL_SERVER_ERROR`)
to understand that the registration of custom types in Gherkin
has a clear outcome in better readability for the executable test
specifications.
Use the following command:
```bash
mvn clean install
```
for running the tests on the project.