Comments (7)
Hi,
Thanks for the feedback!
Two questions:
Is there a reason the @rule approach, or programmatic startup/shutdown inline with your tests isn't suitable?
Have you looked into the option of a Maven mojo that programmatically starts and stops WireMock programmatically? I'm not sure whether there are JVM forking issues with this, but if not then it could be done in very little code and without changing WireMock.
Another tactical approach you could consider is packing WireMock into a WAR (the example-war sub-project in the source shows how to do this) and then running that in Jetty via the Maven plugin.
I agree that some kind of Maven plugin for this might be useful though. I'll add it to the list.
Tom
from wiremock.
One use case for a REST-based stop command is when using WireMock outside of Java: it's easy enough to start WireMock in standalone mode, but the only way to stop it then is to kill its process. It'd be more elegant to be able to ask WireMock to stop itself - c.f. Selenium's /selenium-server/driver/?cmd=shutDownSeleniumServer
URL.
from wiremock.
If you've got sufficient access to the remote machine to be able to start it, surely can also kill -3 it?
I've run it this way on a number of projects and these days I tend to wrap it in a unix service so that I can just service wiremock start
and service wiremock stop
.
Perhaps it's not so simple in under Windows?
from wiremock.
Yes, you can kill the process (and I suspect you could even manage to do something along those lines in Windows), it just strikes me as being more pleasant (and platform agnostic) to be able to issue a graceful shutdown command.
I've just been having a look into doing this, and it does seem fairly achievable - I won't submit a pull request if you're against it, though. :)
from wiremock.
+1, I think this would be useful.
from wiremock.
OK, if you're happy to create a PR, I'm happy to merge it.
from wiremock.
Released in 1.40
from wiremock.
Related Issues (20)
- Introduce a GUI for open source HOT 1
- NPE on WireMockServer.getServeEvents when using a StubRequestFilter HOT 1
- Adding more jettyAcceptors seems to do nothing besides cause thread contention. HOT 1
- align new join handlebar helper with features present in the join provided in the library, but not covered yet
- Expose args in Options so extensions can read it
- Possible memory leak ? HOT 15
- Prevent creating multiple stub mappings with the same ID HOT 1
- Support virtual threads in Jetty server for standalone deploy
- Error when proxying to a host that is only accessible via IPv6 HOT 1
- Formatted dates not in UTC
- __files created by default since v3.6.0 HOT 1
- absent operand must be a non-null string
- Array and data manipulation in handlebars template when using docker
- FileItemPartAdapter returning multipart's field name instead of a filename
- Avoiding reading zipfile entries repeatedly in ClasspathFileSource
- Support disabled state for stub mappings HOT 1
- Add a unique id to the template request model
- Add self-description callback(s) to MatchResult for use in Diff
- Report webhook errors and results as sub-events
- Support mTLS (client certificate) for standalone WireMock client
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wiremock.