https://github.com/wiremock/wiremock-grpc-demos
Examples of how to use the WireMock gRPC extension in Java and standalone
https://github.com/wiremock/wiremock-grpc-demos
Last synced: about 1 year ago
JSON representation
Examples of how to use the WireMock gRPC extension in Java and standalone
- Host: GitHub
- URL: https://github.com/wiremock/wiremock-grpc-demos
- Owner: wiremock
- License: apache-2.0
- Created: 2023-09-27T14:58:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T17:19:25.000Z (almost 2 years ago)
- Last Synced: 2024-08-21T19:32:40.419Z (almost 2 years ago)
- Language: Java
- Homepage: https://wiremock.org/docs/grpc/
- Size: 30.2 MB
- Stars: 3
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# WireMock gRPC Demos
## Java
This example requires at least Java 11 to be installed.
To generate all the necessary code and descriptors then run the tests, run the following command:
```bash
cd java
./gradlew check
```
## Standalone
This example requires `protoc` and at least Java 11 to be installed. Optionally, [grpcurl](https://github.com/fullstorydev/grpcurl)
can be used for testing.
To generate the descriptor file from the .proto file and start the standalone server with gRPC enabled:
```bash
cd standalone
./run.sh
```
If you have `grpcurl` installed you can test the mock as follows:
```bash
grpcurl -d '{"name": "Tom" }' -plaintext \
-proto ExampleServices.proto \
localhost:8000 com.example.grpc.GreetingService/greeting
```
## Docker
This example requires `protoc` and at least Java 11 to be installed. Optionally, [grpcurl](https://github.com/fullstorydev/grpcurl)
can be used for testing.
To generate the descriptor file from the .proto file and start WireMock in Docker with gRPC enabled:
```bash
cd docker
./run.sh
```
If you have `grpcurl` installed you can test the mock as follows:
```bash
grpcurl -d '{"name": "Tom" }' -plaintext \
-proto ExampleServices.proto \
localhost:8080 com.example.grpc.GreetingService/greeting
```