https://linen.dev logo
#general
Title
# general
e

Eric Deandrea

10/25/2023, 7:17 PM
Using wiremock-grpc, it doesn’t seem that the verification stuff is quite there yet. Are there plans to add it?
o

Oleg Nenashev

10/25/2023, 7:41 PM
You mean protocol verification?
aka "contract testing" or whatever similar use-case
e

Eric Deandrea

10/25/2023, 7:42 PM
something like what I can do with the regular `WireMockServer`:
Copy code
this.wireMockServer.verify(5,
      getRequestedFor(urlEqualTo(VILLAIN_RANDOM_URI))
        .withHeader(ACCEPT, equalTo(APPLICATION_JSON))
    );
there’s no equivalent on the gRPC side (
WireMockGrpcService
)
o

Oleg Nenashev

10/25/2023, 7:55 PM
Yep. Good feedback for @Tom ^
e

Eric Deandrea

10/25/2023, 8:17 PM
Its also missing the ability to reset the mocks
I had to manually hang on to a reference to the
WireMock
instance thats passed into the constructor to be able to do that in an
@BeforeEach
method
t

Tom

10/25/2023, 9:42 PM
You’re correct - we haven’t added extension DSL methods for verification yet, but you can still do this with WireMock’s core DSL e.g.: https://github.com/wiremock/wiremock-payments-demo-app/blob/main/src/test/java/wiremock/demo/DemoBffGrpcIntegrationTest.java#L124
You can reset the mocks via the core DSL too (not even sure there’s a need to add this to the extension DSL as it’d be identical)
e

Eric Deandrea

10/26/2023, 1:22 PM
Thanks for that link! To use that do you have to use the
WireMockExtension
approach? In my case I can’t really do that. I can construct a
WireMock
or
WireMockGrpcService
instance