<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Viacheslav Denisenko</title>
    <description>The latest articles on DEV Community by Viacheslav Denisenko (@slavadenisenko).</description>
    <link>https://dev.to/slavadenisenko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4138050%2Fc91ec09c-60ef-4497-af09-a60c2e13453d.jpg</url>
      <title>DEV Community: Viacheslav Denisenko</title>
      <link>https://dev.to/slavadenisenko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/slavadenisenko"/>
    <language>en</language>
    <item>
      <title>When WireMock Becomes Shared Infrastructure: Why I Build StubDeck</title>
      <dc:creator>Viacheslav Denisenko</dc:creator>
      <pubDate>Thu, 19 Nov 2026 18:14:38 +0000</pubDate>
      <link>https://dev.to/slavadenisenko/when-wiremock-becomes-shared-infrastructure-why-i-build-stubdeck-1418</link>
      <guid>https://dev.to/slavadenisenko/when-wiremock-becomes-shared-infrastructure-why-i-build-stubdeck-1418</guid>
      <description>&lt;p&gt;WireMock is easy to like when it is local.&lt;/p&gt;

&lt;p&gt;You create a few stub mappings, start the server, point your application at it, and get predictable responses. For a single developer, JSON files and the Admin API are often enough.&lt;/p&gt;

&lt;p&gt;The interesting problems start when the same WireMock instance becomes shared infrastructure.&lt;/p&gt;

&lt;p&gt;Now several developers are changing mappings. The number of stubs grows. Multiple mappings can target the same endpoint. Someone changes a priority. Someone else changes the same mapping. A runtime change works, but nobody is sure whether it has been persisted.&lt;/p&gt;

&lt;p&gt;At that point, the problem is no longer just creating mocks. It is managing shared state.&lt;/p&gt;

&lt;p&gt;That is the problem I wanted to explore with &lt;strong&gt;StubDeck&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;StubDeck is an independent open-source project. It does not replace WireMock and is not affiliated with the WireMock project. It acts as a management layer around an existing WireMock environment.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The point where JSON stops being enough&lt;/strong&gt;&lt;br&gt;
A normal WireMock mapping is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"request"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"urlPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/api/customer/123"&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;  
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"jsonBody"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"John"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a small local setup, I would not add another tool. Editing the file directly is faster.&lt;/p&gt;

&lt;p&gt;A shared environment creates a different set of questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many mappings are registered right now?&lt;/li&gt;
&lt;li&gt;Which endpoints already have stubs?&lt;/li&gt;
&lt;li&gt;Why did this request hit that mapping?&lt;/li&gt;
&lt;li&gt;Are several mappings competing for the same request?&lt;/li&gt;
&lt;li&gt;Which priorities are configured?&lt;/li&gt;
&lt;li&gt;Who changed this mapping?&lt;/li&gt;
&lt;li&gt;Does it have a pending runtime change?&lt;/li&gt;
&lt;li&gt;Has the current runtime state been persisted?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those questions are not about JSON syntax. They are about visibility, coordination, and state management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Making overlapping mappings visible&lt;/strong&gt;&lt;br&gt;
One of the first areas I focused on was overlapping mappings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;payments&lt;/span&gt;
&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;payments&lt;/span&gt;
&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;payments&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same method and URL do not automatically mean the mappings are equivalent. Headers, body matchers, query parameters, and other request criteria can make them intentionally different.&lt;/p&gt;

&lt;p&gt;But this is still a useful place to look for ambiguity.&lt;/p&gt;

&lt;p&gt;WireMock has a priority mechanism for this. A lower numeric value means a higher priority. If multiple matching stubs have the same priority, the most recently added matching stub takes precedence.&lt;/p&gt;

&lt;p&gt;StubDeck groups mappings by method and URL on a &lt;strong&gt;Conflicts&lt;/strong&gt; page so these areas can be inspected directly instead of discovered by searching through files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;payments&lt;/span&gt;  

&lt;span class="nc"&gt;Priority&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;    &lt;span class="nc"&gt;Payment&lt;/span&gt; &lt;span class="n"&gt;declined&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;risk&lt;/span&gt;
&lt;span class="nc"&gt;Priority&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;    &lt;span class="nc"&gt;Payment&lt;/span&gt; &lt;span class="n"&gt;approved&lt;/span&gt;
&lt;span class="nc"&gt;Priority&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;   &lt;span class="nc"&gt;Default&lt;/span&gt; &lt;span class="n"&gt;payment&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a mapping is saved, StubDeck can apply a conflict strategy: BLOCK, WARN, or ALLOW.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjie1l5oil2gsf8044sxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjie1l5oil2gsf8044sxy.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A form when it helps, raw JSON when it does not&lt;/strong&gt;&lt;br&gt;
For common changes, a form is convenient:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Method:     POST
URL:        /api/payments
Status:     200
Priority:   5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But a WireMock mapping can be much richer than a fixed form. I did not want the UI to hide WireMock itself.&lt;/p&gt;

&lt;p&gt;The editor therefore supports both a form for common request/response fields and a Raw JSON view. JSON can be validated before it is saved, and templates provide starting points for common REST and error scenarios.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8z2ty7e5fmcopyvk1zt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft8z2ty7e5fmcopyvk1zt.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pending changes become ownership&lt;/strong&gt;&lt;br&gt;
The next problem appears only when several people use the same server.&lt;/p&gt;

&lt;p&gt;StubDeck tracks runtime changes that have not yet been persisted or discarded. A pending change has an owner. While that pending change exists, another user cannot silently overwrite or delete the same mapping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pending change by: Ivan Petrov
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is deliberately simpler than a distributed collaborative editing model. It solves a practical problem: make ownership of an unfinished runtime change visible and prevent accidental overwrites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Runtime state is not persisted state&lt;/strong&gt;&lt;br&gt;
This matters especially in containerized shared environments.&lt;/p&gt;

&lt;p&gt;WireMock exposes an Admin API for changing mappings at runtime and an operation for persisting mappings. Treating runtime state and persisted state as the same thing can produce a surprise after a restart.&lt;/p&gt;

&lt;p&gt;StubDeck makes the distinction explicit and exposes two high-level actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Save to disk
Discard changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is not to invent a new persistence model. It is to make the existing lifecycle visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who changed this mapping?&lt;/strong&gt;&lt;br&gt;
Once a mock server becomes shared, this question appears sooner or later.&lt;/p&gt;

&lt;p&gt;StubDeck keeps a changelog for CREATE, UPDATE, and DELETE operations, including the user, mapping, and timestamp.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;
&lt;span class="no"&gt;UPDATE&lt;/span&gt;
&lt;span class="n"&gt;ivan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;petrov&lt;/span&gt;
&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;payments&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That does not turn StubDeck into a version control system, but it is enough to answer a common debugging question quickly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxqgw4qs2ipzbls74x8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxqgw4qs2ipzbls74x8i.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two ways to connect&lt;/strong&gt;&lt;br&gt;
StubDeck supports two mapping sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File system for direct work with mapping JSON files.&lt;/li&gt;
&lt;li&gt;Admin API for an already running WireMock instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;StubDeck does not proxy mocked application traffic. It sits next to WireMock as a management layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why not just keep editing JSON?&lt;/strong&gt;&lt;br&gt;
You should, when that is the simplest solution.&lt;/p&gt;

&lt;p&gt;If one developer owns a small local WireMock setup, adding a management UI can be unnecessary overhead.&lt;/p&gt;

&lt;p&gt;The tool starts to make sense when several conditions appear together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;many mappings&lt;/li&gt;
&lt;li&gt;shared WireMock&lt;/li&gt;
&lt;li&gt;multiple developers&lt;/li&gt;
&lt;li&gt;overlapping endpoints&lt;/li&gt;
&lt;li&gt;runtime changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the distinction I care about. StubDeck is not an attempt to make JSON prettier. It is an attempt to manage a shared WireMock environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current state and limitations&lt;/strong&gt;&lt;br&gt;
The current project uses Java 25 and Spring Boot 4.0.5. The local development environment uses WireMock 3.13.2 through Docker Compose, together with a test LDAP server.&lt;/p&gt;

&lt;p&gt;There are also intentional limitations in the first public version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one WireMock instance is managed at a time;&lt;/li&gt;
&lt;li&gt;StubDeck itself must run as a single application replica;&lt;/li&gt;
&lt;li&gt;a production Docker image for StubDeck is not provided yet;&lt;/li&gt;
&lt;li&gt;multi-instance and multi-replica support are roadmap items.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The single-replica restriction is not a throughput limitation. Pending-change ownership and the changelog currently depend on local application state. Multiple replicas would need shared state and coordination to preserve consistent behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I want to build next&lt;/strong&gt;&lt;br&gt;
The first major direction is multi-instance support.&lt;/p&gt;

&lt;p&gt;The second direction is change management. Instead of recording only individual actions, I want to treat a group of changes as a unit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Change set #42
+ CREATE  POST /payments
~ UPDATE  GET  /accounts/*
- DELETE  GET  /legacy/user

[View diff]  [Apply]  [Discard]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That naturally leads to diffs, rollback, review, and eventually promotion of a change set between environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I am publishing it&lt;/strong&gt;&lt;br&gt;
I am publishing StubDeck because I want to understand how common this problem is outside the environments I have worked with.&lt;br&gt;
I am especially interested in teams that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;have hundreds or thousands of mappings;&lt;/li&gt;
&lt;li&gt;share one WireMock instance across developers or teams;&lt;/li&gt;
&lt;li&gt;run separate DEV, QA, or integration environments;&lt;/li&gt;
&lt;li&gt;need an audit trail for mapping changes;&lt;/li&gt;
&lt;li&gt;regularly deal with overlapping stubs and priority questions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/SlavaDenisenko/stubdeck" rel="noopener noreferrer"&gt;https://github.com/SlavaDenisenko/stubdeck&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If that sounds familiar, I would like to hear how you manage it today and which part is the most painful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technical references&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WireMock stubbing and priority: &lt;a href="https://wiremock.org/docs/stubbing/" rel="noopener noreferrer"&gt;https://wiremock.org/docs/stubbing/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;WireMock Administration API: &lt;a href="https://wiremock.org/docs/standalone/administration/" rel="noopener noreferrer"&gt;https://wiremock.org/docs/standalone/administration/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;WireMock Admin API reference: &lt;a href="https://wiremock.org/docs/standalone/admin-api-reference/" rel="noopener noreferrer"&gt;https://wiremock.org/docs/standalone/admin-api-reference/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>testing</category>
      <category>java</category>
      <category>opensource</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
