WireMock RestDocs stub() method is a no-op
deprecating the method and going towards document() fix by @dsyer fixes gh-1092
This commit is contained in:
@@ -22,6 +22,15 @@
|
||||
<include>**/model/Fraud*.*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/generated-snippets/stubs</directory>
|
||||
<outputDirectory>
|
||||
META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings
|
||||
</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/snippets/stubs</directory>
|
||||
<outputDirectory>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
server.port=0
|
||||
@@ -36,6 +36,7 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
|
||||
import static org.springframework.cloud.contract.wiremock.restdocs.WireMockRestDocs.verify;
|
||||
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@@ -69,8 +70,8 @@ public class StubGeneratorTests {
|
||||
.andExpect(jsonPath("$.rejectionReason").value("Amount too high"))
|
||||
.andDo(verify().jsonPath("$.clientId")
|
||||
.jsonPath("$[?(@.loanAmount > 1000)]")
|
||||
.contentType(MediaType.valueOf("application/vnd.fraud.v1+json"))
|
||||
.stub("markClientAsFraud"));
|
||||
.contentType(MediaType.valueOf("application/vnd.fraud.v1+json")))
|
||||
.andDo(document("markClientAsFraud"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -85,8 +86,8 @@ public class StubGeneratorTests {
|
||||
.andExpect(jsonPath("$.rejectionReason").doesNotExist())
|
||||
.andDo(verify().jsonPath("$.clientId")
|
||||
.jsonPath("$[?(@.loanAmount <= 1000)]")
|
||||
.contentType(MediaType.valueOf("application/vnd.fraud.v1+json"))
|
||||
.stub("markClientAsNotFraud"));
|
||||
.contentType(MediaType.valueOf("application/vnd.fraud.v1+json")))
|
||||
.andDo(document("markClientAsNotFraud"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user