Sync docs from master to gh-pages
This commit is contained in:
@@ -52,7 +52,8 @@ public class WiremockImportApplicationTests {
|
||||
|
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Actually, WireMock always loads mappings from <code class="literal">src/test/resources/mappings</code> <span class="strong"><strong>as
|
||||
well as</strong></span> the custom locations in the stubs attribute. To change this behavior, you can
|
||||
also specify a files root as described in the next section of this document.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_using_files_to_specify_the_stub_bodies" href="#_using_files_to_specify_the_stub_bodies"></a>11.2 Using Files to Specify the Stub Bodies</h2></div></div></div><p>WireMock can read response bodies from files on the classpath or the file system. In that
|
||||
also specify a files root as described in the next section of this document.</p></td></tr></table></div><p>If you’re using Spring Cloud Contract’s default stub jars, then your
|
||||
stubs are stored under <code class="literal">/META-INF/group-id/artifact-id/versions/mappings/</code> folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.</p><pre class="programlisting">@AutoConfigureWireMock(port = <span class="hl-number">0</span>, stubs = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath*:/META-INF/**/mappings/**/*.json"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_using_files_to_specify_the_stub_bodies" href="#_using_files_to_specify_the_stub_bodies"></a>11.2 Using Files to Specify the Stub Bodies</h2></div></div></div><p>WireMock can read response bodies from files on the classpath or the file system. In that
|
||||
case, you can see in the JSON DSL that the response has a <code class="literal">bodyFileName</code> instead of a
|
||||
(literal) <code class="literal">body</code>. The files are resolved relative to a root directory (by default,
|
||||
<code class="literal">src/test/resources/__files</code>). To customize this location you can set the <code class="literal">files</code>
|
||||
|
||||
@@ -6436,7 +6436,8 @@ public class WiremockImportApplicationTests {
|
||||
|
||||
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Actually, WireMock always loads mappings from <code class="literal">src/test/resources/mappings</code> <span class="strong"><strong>as
|
||||
well as</strong></span> the custom locations in the stubs attribute. To change this behavior, you can
|
||||
also specify a files root as described in the next section of this document.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_using_files_to_specify_the_stub_bodies" href="#_using_files_to_specify_the_stub_bodies"></a>11.2 Using Files to Specify the Stub Bodies</h2></div></div></div><p>WireMock can read response bodies from files on the classpath or the file system. In that
|
||||
also specify a files root as described in the next section of this document.</p></td></tr></table></div><p>If you’re using Spring Cloud Contract’s default stub jars, then your
|
||||
stubs are stored under <code class="literal">/META-INF/group-id/artifact-id/versions/mappings/</code> folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.</p><pre class="programlisting">@AutoConfigureWireMock(port = <span class="hl-number">0</span>, stubs = <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"classpath*:/META-INF/**/mappings/**/*.json"</span>)</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_using_files_to_specify_the_stub_bodies" href="#_using_files_to_specify_the_stub_bodies"></a>11.2 Using Files to Specify the Stub Bodies</h2></div></div></div><p>WireMock can read response bodies from files on the classpath or the file system. In that
|
||||
case, you can see in the JSON DSL that the response has a <code class="literal">bodyFileName</code> instead of a
|
||||
(literal) <code class="literal">body</code>. The files are resolved relative to a root directory (by default,
|
||||
<code class="literal">src/test/resources/__files</code>). To customize this location you can set the <code class="literal">files</code>
|
||||
|
||||
@@ -10172,6 +10172,9 @@ public class WiremockImportApplicationTests {
|
||||
well as</emphasis> the custom locations in the stubs attribute. To change this behavior, you can
|
||||
also specify a files root as described in the next section of this document.</simpara>
|
||||
</note>
|
||||
<simpara>If you’re using Spring Cloud Contract’s default stub jars, then your
|
||||
stubs are stored under <literal>/META-INF/group-id/artifact-id/versions/mappings/</literal> folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.</simpara>
|
||||
<programlisting language="java" linenumbering="unnumbered">@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")</programlisting>
|
||||
</section>
|
||||
<section xml:id="_using_files_to_specify_the_stub_bodies">
|
||||
<title>Using Files to Specify the Stub Bodies</title>
|
||||
|
||||
Reference in New Issue
Block a user