https://github.com/reactiverse/reactiverse-junit5-extensions
Extensions for the Vert.x JUnit5 support
https://github.com/reactiverse/reactiverse-junit5-extensions
Last synced: 9 months ago
JSON representation
Extensions for the Vert.x JUnit5 support
- Host: GitHub
- URL: https://github.com/reactiverse/reactiverse-junit5-extensions
- Owner: reactiverse
- License: apache-2.0
- Created: 2020-04-06T13:33:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-11T17:08:17.000Z (almost 4 years ago)
- Last Synced: 2025-04-08T21:22:52.801Z (10 months ago)
- Language: Java
- Size: 77.1 KB
- Stars: 7
- Watchers: 7
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Reactiverse Vert.x JUnit 5 integration extensions
This project contains a set of extensions for writing JUnit 5 tests.
We currently offer:
- `reactiverse-junit5-web-client`: support for injecting the Vert.x `WebClient` and assertions using `TestRequest`
- `reactiverse-junit5-web-client-rx-java` (RxJava bindings)
- `reactiverse-junit5-web-client-rx-java2` (RxJava2 bindings)
- `reactiverse-junit5-web-client-rx-java3` (RxJava3 bindings)
## Web Client assertions
To start using it, add the following dependencies:
```xml
io.vertx
vertx-junit5
io.reactiverse
reactiverse-junit5-web-client
0.4.0
```
To send a request to `localhost` and assert the result:
```java
@ExtendWith(VertxExtension.class)
public class LocalhostTest {
// Define the WebClient options
@WebClientOptionsInject
public WebClientOptions options = new WebClientOptions()
.setDefaultHost("localhost")
.setDefaultPort(9000);
@Test
public void testLocalhost(Vertx vertx, VertxTestContext testContext, WebClient client) {
testRequest(client, HttpMethod.GET, "/path")
.expect(statusCode(200), statusMessage("Ciao!"))
.send(testContext);
}
}
```
For more details on the available assertions, look at [`TestRequest` javadoc](https://www.javadoc.io/doc/io.reactiverse/reactiverse-junit5-web-client/latest/io/reactiverse/junit5/web/TestRequest.html).
## License
Copyright (c) 2020 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.