Updated docs
This commit is contained in:
@@ -28,7 +28,7 @@ Example of usage in Spock tests:
|
||||
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
include::src/test/groovy/io/codearte/accurest/stubrunner/junit/AccurestRuleSpec.java[tags=classrule]
|
||||
include::src/test/groovy/io/codearte/accurest/stubrunner/junit/AccurestRuleSpec.groovy[tags=classrule]
|
||||
----
|
||||
|
||||
Example of usage in JUnit tests:
|
||||
|
||||
@@ -23,14 +23,14 @@ public class AccurestRuleJUnitTest {
|
||||
System.getProperties().setProperty("stubrunner.stubs.classifier", "stubs");
|
||||
}
|
||||
|
||||
// tag:classrule[]
|
||||
// tag::classrule[]
|
||||
@ClassRule public static AccurestRule rule = new AccurestRule()
|
||||
.repoRoot(repoRoot())
|
||||
.downloadStub("io.codearte.accurest.stubs", "loanIssuance")
|
||||
.downloadStub("io.codearte.accurest.stubs:fraudDetectionServer");
|
||||
// end:classrule[]
|
||||
// end::classrule[]
|
||||
|
||||
// tag:test[]
|
||||
// tag::test[]
|
||||
@Test
|
||||
public void should_start_wiremock_servers() throws Exception {
|
||||
// expect: 'WireMocks are running'
|
||||
@@ -46,7 +46,7 @@ public class AccurestRuleJUnitTest {
|
||||
then(httpGet(rule.findStubUrl("loanIssuance").toString() + "/name")).isEqualTo("loanIssuance");
|
||||
then(httpGet(rule.findStubUrl("fraudDetectionServer").toString() + "/name")).isEqualTo("fraudDetectionServer");
|
||||
}
|
||||
// end:test[]
|
||||
// end::test[]
|
||||
|
||||
private static String repoRoot() {
|
||||
try {
|
||||
|
||||
@@ -18,7 +18,7 @@ class AccurestRuleSpec extends Specification {
|
||||
System.getProperties().setProperty("stubrunner.stubs.classifier", "stubs");
|
||||
}
|
||||
|
||||
// tag:classrule[]
|
||||
// tag::classrule[]
|
||||
@ClassRule @Shared AccurestRule rule = new AccurestRule()
|
||||
.repoRoot(AccurestRuleSpec.getResource("/m2repo").toURI().toString())
|
||||
.downloadStub("io.codearte.accurest.stubs", "loanIssuance")
|
||||
@@ -38,5 +38,5 @@ class AccurestRuleSpec extends Specification {
|
||||
"${rule.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
|
||||
"${rule.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
|
||||
}
|
||||
// end:classrule[]
|
||||
// end::classrule[]
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ for the following configuration file:
|
||||
|
||||
[source,yml,indent=0]
|
||||
----
|
||||
include::src/test/resources/application.yml[tags=test]
|
||||
include::src/test/resources/application.yml[]
|
||||
----
|
||||
Reference in New Issue
Block a user