Skip to content

Examples of how to use the WireMock gRPC extension in Java and standalone

License

Notifications You must be signed in to change notification settings

alejandrolorefice/wiremock-grpc-demos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

cd java
./gradlew check

Standalone

This example requires protoc and at least Java 11 to be installed. Optionally, grpcurl can be used for testing.

To generate the descriptor file from the .proto file and start the standalone server with gRPC enabled:

cd standalone
./run.sh

If you have grpcurl installed you can test the mock as follows:

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 can be used for testing.

To generate the descriptor file from the .proto file and start WireMock in Docker with gRPC enabled:

cd docker
./run.sh

If you have grpcurl installed you can test the mock as follows:

grpcurl -d '{"name": "Tom" }' -plaintext \
  -proto ExampleServices.proto \
  localhost:8080 com.example.grpc.GreetingService/greeting

About

Examples of how to use the WireMock gRPC extension in Java and standalone

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 92.4%
  • Shell 7.6%