small fixes - mostly maven related

[ci skip]
This commit is contained in:
Mariusz Smykula
2016-04-24 21:17:40 +02:00
parent b42774e1ab
commit 767d414605

View File

@@ -49,7 +49,7 @@ dependencies {
----
Read more: https://github.com/Codearte/accurest-maven-plugin[accurest-maven-plugin]
Read more: http://codearte.github.io/accurest-maven-plugin/[accurest-maven-plugin]
===== Add stubs
@@ -58,8 +58,11 @@ Directory containing stub definitions is treated as a class name, and each stub
We assume that it contains at least one directory which will be used as test class name. If there is more than one level of nested directories all except the last one will be used as package name.
So with following structure
src/test/resources/stubs/myservice/shouldCreateUser.groovy
src/test/resources/stubs/myservice/shouldReturnUser.groovy
[source,groovy,indent=0]
----
src/test/accurest/myservice/shouldCreateUser.groovy
src/test/accurest/myservice/shouldReturnUser.groovy
----
Accurest will create test class `defaultBasePackage.MyService` with two methods
- shouldCreateUser()
@@ -94,7 +97,7 @@ accurest {
- **contractsDslDir** - directory containing contracts written using the GroovyDSL. By default `$rootDir/src/test/accurest`
- **generatedTestSourcesDir** - test source directory where tests generated from Groovy DSL should be placed. By default `$buildDir/generated-test-sources/accurest`
- **stubsOutputDir** - dir where the generated Wiremock stubs from Groovy DSL should be placed
- **targetFramework** - the target test framework to be used; currently Spock and JUnit are supported with Spock being the default framework
- **targetFramework** - the target test framework to be used; currently Spock and JUnit are supported with JUnit being the default framework
===== Base class for tests
@@ -176,7 +179,7 @@ Underneath LoanApplication makes a call to FraudDetection service. This request
</plugin>
----
Read more: [accurest-maven-plugin](https://github.com/Codearte/accurest-maven-plugin)
Read more: http://codearte.github.io/accurest-maven-plugin/[accurest-maven-plugin]
==== Add stubs
@@ -224,17 +227,17 @@ To change default configuration just add `configuration` section to plugin defin
</plugin>
----
===== Configuration options
===== Important configuration options
- **testMode** - defines mode for acceptance tests. By default `MockMvc` which is based on Spring's MockMvc. It can also be changed to `JaxRsClient` or to `Explicit` for real HTTP calls.
- **basePackageForTests** - specifies base package for all generated tests. By default set to `io.codearte.accurest.tests`.
- **ruleClassForTests** - specifies Rule which should be added to generated test classes.
- **baseClassForTests** - base class for generated tests. By default `spock.lang.Specification`.
- **contractsDir** - directory containing contracts written using the GroovyDSL. By default `/src/test/accurest`.
- **generatedTestSourcesDir** - test source directory where tests generated from Groovy DSL should be placed. By default `target/generated-test-sources/accurest`.
- **mappingsDir** - dir where the generated Wiremock stubs from Groovy DSL should be placed.
- **testFramework** - the target test framework to be used; currently Spock and JUnit are supported with Spock being the default framework
For complete information take a look at http://codearte.github.io/accurest-maven-plugin/plugin-info.html[Plugin Documentation]
===== Base class for tests
When using Accurest in default MockMvc you need to create a base specification for all generated acceptance tests. In this class you need to point to endpoint which should be verified.
@@ -307,7 +310,7 @@ Sample configuration:
<plugin>
<groupId>io.codearte.accurest</groupId>
<artifactId>accurest-maven-plugin</artifactId>
<version>${accurest.version}</version>
<version>${accurest-plugin.version}</version>
<executions>
<execution>
<goals>