Java client for https://github.com/tokopedia/gripmock
- DSL-like api
- Testcontainers wrapper
- Setup gripmock server
- Obtain the
Gripmock
instance - Construct the stub with
[Stub.newStub()](src/main/java/org/github/olex/gripmock4j/stub/Stub.java)
- Pass it to
Gripmock
var gripmock = new Gripmock(gripmockContainer.getHost(), gripmockContainer.getHttpServerPort());
var req = Simple.Request.newBuilder()
.setName("olex")
.build();
var res = Simple.Reply.newBuilder()
.setMessage("hi!")
.setReturnCode(201)
.build();
gripmock.addStubMapping(
Stub.newStub()
.forService(GripmockGrpc.getServiceDescriptor())
.withMethod(GripmockGrpc.getSayHelloMethod())
.forCall(req)
.answer(res)
)
- Add
/find
and/get
support for stubbing lookup - Move to gson instead of jackson