skip to content

Lifecycle and Isolation

How a stub server is started, where it sits relative to the suite that needs it, and what is wiped between tests. Leaked stub state is a top cause of flaky suites.

on this pageshow

explore

questions

page 2 of 2

When does WireMock standalone read the stub files under its root directory?

level: middleimportance: nice to knowfreq 46%

basics

~20 s

The read happens as the process starts: WireMock standalone builds its stub set from mappings and __files under the root directory. A file written afterwards is not served until a restart. Changing a running server is an admin API call.

open as a page

How do you ship a WireMock stub set as a versioned artifact instead of a mounted directory?

level: seniorimportance: nice to knowfreq 36%

basics

~20 s

Package mappings and __files under one prefix inside a jar and put it on WireMock's launcher classpath. Start standalone with --load-resources-from-classpath naming that prefix. The set then travels as a versioned, published artifact rather than a bind mount.

open as a page

showing 31–32 of 32