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

Ekta Bansal

10/10/2023, 7:33 AM
how we can mock apis through wiremock in springboot but not for writting test cases, i just want to create request and response in springboot then i want to call this apis from my local machine?
l

Lee Turner

10/10/2023, 7:47 AM
You can run wiremock standalone (jar or docker) which might be what you are looking for. Docs for that can be found here - https://wiremock.org/docs/standalone/ I also setup an example repo with wiremock running in docker here - https://github.com/leeturner/wiremock-standalone-docker-example
e

Ekta Bansal

10/10/2023, 7:49 AM
actually i want to run my wiremock in aws lambda service, for that i need to add its dependency in pom.xml, which seems not possible doing with standalone jar, i am using standalone jar only but because of this issue, i want to switch to springboot.
@Lee Turner
l

Lee Turner

10/10/2023, 7:52 AM
OK, I am not sure I understand what you are looking for. You want to run wiremock in aws lambda and connect to it from a springboot service ?
e

Ekta Bansal

10/10/2023, 7:53 AM
i want to run my wiremock in aws lamdba, how can i run standalone jar there?
l

Lee Turner

10/10/2023, 8:00 AM
Ah, sorry, I don’t have any experience running wiremock in lambda. According to this page it would seem running in headless mode might be the way to go - https://wiremock.org/docs/running-without-http-server/
e

Ekta Bansal

10/10/2023, 8:10 AM
do u have any doc for how we can mock apis through wiremock in springboot but not for writting test cases, i just want to create request and response in springboot then i want to call this apis from my local machine?
l

Lee Turner

10/10/2023, 6:26 PM
I don’t know of any documentation. I guess you could access the wiremock admin endpoints to load the stub mappings from a spring boot service. You can find details of the admin interface here - https://wiremock.org/docs/standalone/admin-api-reference/