hello everybody. i'm not sure if this is the corre...
# pact-jvm
h
hello everybody. i'm not sure if this is the correct place to ask this. i am trying to test a contract against a provider that exposes it's API through an endpoint
/graphql
. the request is done through 2 methods: 1. lambda sdk call by another back end service 2. front end POST through the aws api gateway in both cases, the endpoints are not set up in the application itself but rather through lambda or aws api gateway (and the cdk) when running the test on the provider side, i always get 404 because the endpoint
/graphql
doesn't exist when the test is running locally. any ideas how to get around this? is using a Message Contract rather than an HTTP contract the best use here?
i understand there are ideas here: https://docs.pact.io/recipes/apigateway however, i can't figure out how to implement them
u
I don't use API Gateway for the verification tests. For our lambda services, we run a node express app that hosts the lambda, and verify against that.
☝️ 2
h
I ended up using WireMock to intercept the
/graphql
and bypass the gateway layer
m
Wiremock? can you please elaborate? Hopefully you’re not mocking out the whole endpoint (i.e. testing a mock, and not the real provider)?
h
all of our microservices communicate through graphql via lambda or through a
/graphql
endpoint in a front end. the
/graphql
endpoint is set up in AWS CDK and api gateway. our provider microservices are not aware of the endpoints when testing locally. i used WireMock to listen for the
/graphql
post and pass it along to the logic controller
m
oh right. I didn’t realise WireMock could also act as a proxy
👍 1