Sync docs from master to gh-pages

This commit is contained in:
buildmaster
2020-02-07 13:28:51 +00:00
parent 691ff4052e
commit 435d6510b1
44 changed files with 4875 additions and 4748 deletions

View File

@@ -2214,8 +2214,7 @@ can also provide the offline work switch (<code>StubRunnerProperties.StubsMode.L
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.NONE)
<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">@SpringBootTest(webEnvironment = WebEnvironment.NONE)
@AutoConfigureStubRunner(ids = {
"com.example:http-server-dsl:0.0.1:stubs" }, stubsMode = StubRunnerProperties.StubsMode.LOCAL)
public class LoanApplicationServiceTests {</code></pre>
@@ -2411,11 +2410,11 @@ start the server side <code>FraudDetectionController</code>. The following listi
package com.example.fraud;
import io.restassured.module.mockmvc.RestAssuredMockMvc;
import org.junit.Before;
import org.junit.jupiter.api.BeforeEach;
public class FraudBase {
@Before
@BeforeEach
public void setup() {
RestAssuredMockMvc.standaloneSetup(new FraudDetectionController(),
new FraudStatsController(stubbedStatsProvider()));
@@ -13819,8 +13818,7 @@ your test. The following code shows an example:</p>
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureWireMock(port = 0)
public class WiremockForDocsTests {
@@ -13828,7 +13826,7 @@ public class WiremockForDocsTests {
@Autowired
private Service service;
@Before
@BeforeEach
public void setup() {
this.service.setBase("http://localhost:"
+ this.environment.getProperty("wiremock.server.port"));
@@ -13960,21 +13958,33 @@ instance, as the following example shows:</p>
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class WiremockForDocsClassRuleTests {
// Start WireMock on some dynamic port
// for some reason `dynamicPort()` is not working properly
@ClassRule
public static WireMockClassRule wiremock = new WireMockClassRule(
WireMockSpring.options().dynamicPort());
public static WireMockServer wiremock = new WireMockServer(WireMockSpring.options().dynamicPort());
@BeforeAll
static void setupClass() {
wiremock.start();
}
@AfterEach
void after() {
wiremock.resetAll();
}
@AfterAll
static void clean() {
wiremock.shutdown();
}
// A service that calls out over HTTP to wiremock's port
@Autowired
private Service service;
@Before
@BeforeEach
public void setup() {
this.service.setBase("http://localhost:" + wiremock.port());
}
@@ -14072,8 +14082,7 @@ a Spring <code>MockRestServiceServer</code>. The following code shows an example
<div class="content">
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.NONE)
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootTest(webEnvironment = WebEnvironment.NONE)
public class WiremockForDocsMockServerApplicationTests {
@Autowired
@@ -19526,6 +19535,7 @@ import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.restdocs.JUnitRestDocumentation;