SberMarket-Tech / grpc-wiremock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grpc-wiremock

Wiremock is a great way to test your connected services. But it has one drawback. And that is support for proto contracts.

grpc-wiremock is designed to solve this problem, and also provide a handy tool for generating mocks. And their automatic reloading.

Here you can compare the functionality with existing solutions.

Getting started

Quick start

Check out our wearable repo with an example service.

There you will find how the service interacts with the mock and a docker-compose file for quick startup.

Interface

MOCKS_PATH="$(PWD)/test/wiremock"
CERTS_PATH="$(PWD)/certs"
CONTRACTS_PATH="$(PWD)/deps"
WIREMOCK_GUI_PORT=9000

# grpc-wiremock supports multiple APIs simultaneously.
# This means that the another APIs will go up
# on port 8001, 8002, etc.

YOUR_MOCK_API=8000  

docker run \
  -p ${WIREMOCK_GUI_PORT}:${WIREMOCK_GUI_PORT} \
  -p ${YOUR_MOCK_API}:${YOUR_MOCK_API} \
  -v ${MOCKS_PATH}:/home/mock \
  -v ${CERTS_PATH}:/etc/ssl/mock/share \
  -v ${CONTRACTS_PATH}:/proto \
  SberMarket-Tech/grpc-wiremock@latest

Overview

In general, grpc-wiremock contains two main components.

You can read more about each of them here:

In the diagram you can see how your requests are distributed within the grpc-wiremock container.

grpc-wiremock

Benchmarks

You can also read about performance with multiple mock APIs here.

License

grpc-wiremock is under the Apache License, Version 2.0. See the LICENSE file for details.

About

License:Other


Languages

Language:Go 88.6%Language:Shell 5.3%Language:Smarty 3.5%Language:Dockerfile 1.2%Language:Makefile 1.2%Language:Roff 0.2%