https://github.com/josdem/juice-webclient
This is a library that shows how to test a third-party service using webclient
https://github.com/josdem/juice-webclient
gradle java junit5 restclient webflux
Last synced: 2 months ago
JSON representation
This is a library that shows how to test a third-party service using webclient
- Host: GitHub
- URL: https://github.com/josdem/juice-webclient
- Owner: josdem
- Created: 2022-05-01T21:56:49.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T16:22:53.000Z (over 2 years ago)
- Last Synced: 2025-01-17T15:52:31.261Z (over 1 year ago)
- Topics: gradle, java, junit5, restclient, webflux
- Language: Java
- Homepage:
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Juice WebClient
----------------------------------------
[](https://app.travis-ci.com/josdem/juice-webclient)
[](https://sonar.josdem.io/dashboard?id=com.josdem.jugoterapia.webclient%3Ajuice-webclient)
This project shows how to test an API as library using [WebClient](https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/html/boot-features-webclient.html) with [Junit Jupiter](https://junit.org/junit5/docs/current/user-guide/)
#### To test the project with Gradle
```bash
gradle test
```
#### To test the project with Maven
```bash
mvn test
```
### To run a single test with Gradle
```bash
gradle test --tests ${testName}
```
### To run a single test with Maven
```bash
mvn test -Dtest=${testName}
```
where:
- `${testName}` is the test name you want to execute
### To publish library to artifactory using Gradle
```bash
export ARTIFACTORY_USER=${username}
export ARTIFACTORY_PASSWORD=${password}
gradle publish
```
where:
- `${username}` Is artifactory username
- `${password}` Is artifactory password
#### To run tests with Jacoco and Sonarqube
```bash
gradle jacocoTestReport sonarqube test
```
### To publish library to artifactory using Maven
```bash
mvn deploy
```
Make sure you setup your artifactory credentials in `${USER_HOME}/.m2/settings.xml`
```xml
artifactory
username
password
```
**Note:** If you want to learn more and publish your own library, feel free to drop me a message on my home page website and ask for a Jfrog credentials.
#### For more information:
Visit our wiki page: [Wiki page](https://github.com/josdem/juice-webclient/wiki)
#### Read this as reference:
* https://josdem.io/techtalk/spring/spring_boot_webclient/
* https://josdem.io/techtalk/spring/spring_webflux_client/
* https://josdem.io/techtalk/spring/spring_webflux_artifactory_library/