Full name:
org.springframework.cloud:spring-cloud-contract-maven-plugin:4.0.1:generateTests
Description:
Attributes:
test
.generate-test-sources
.Name | Type | Since | Description |
---|---|---|---|
<assertJsonSize> |
boolean |
- |
Incubating feature. You can check the size of JSON arrays. If not
turned on explicitly will be disabled. Default value is: false .User property is: spring.cloud.contract.verifier.assert.size . |
<baseClassForTests> |
String |
- |
(no description) |
<baseClassMappings> |
List |
- |
A way to override any base class mappings. The keys are regular
expressions on the package name of the contract and the values FQN
to a base class for that given expression. Example of a mapping
.*.com.example.v1..* ->
com.example.SomeBaseClass When a contract's package
matches the provided regular expression then extending class will
be the one provided in the map - in this case
com.example.SomeBaseClass .User property is: baseClassMappings . |
<basePackageForTests> |
String |
- |
(no description) |
<contractDependency> |
Dependency |
- |
(no description) User property is: contractDependency . |
<contractsDirectory> |
File |
- |
(no description) Default value is: ${project.basedir}/src/test/resources/contracts .User property is: spring.cloud.contract.verifier.contractsDirectory . |
<contractsMode> |
StubRunnerProperties$StubsMode |
- |
Picks the mode in which stubs will be found and registered. Default value is: CLASSPATH .User property is: contractsMode . |
<contractsPath> |
String |
- |
The path in the JAR with all the contracts where contracts for this
particular service lay. If not provided will be resolved to
groupid/artifactid . Example: If groupid
is com.example and artifactid is
service then the resolved path will be
/com/example/artifactid User property is: contractsPath . |
<contractsProperties> |
Map |
- |
Map of properties that can be passed to custom
StubDownloaderBuilder .User property is: contractsProperties . |
<contractsRepositoryPassword> |
String |
- |
The password to be used to connect to the repo with contracts. User property is: contractsRepositoryPassword . |
<contractsRepositoryProxyHost> |
String |
- |
The proxy host to be used to connect to the repo with contracts. User property is: contractsRepositoryProxyHost . |
<contractsRepositoryProxyPort> |
Integer |
- |
The proxy port to be used to connect to the repo with contracts. User property is: contractsRepositoryProxyPort . |
<contractsRepositoryUrl> |
String |
- |
The URL from which a contracts should get downloaded. If not
provided but artifactid / coordinates notation was provided then
the current Maven's build repositories will be taken into
consideration. User property is: contractsRepositoryUrl . |
<contractsRepositoryUsername> |
String |
- |
The user name to be used to connect to the repo with contracts. User property is: contractsRepositoryUsername . |
<deleteStubsAfterTest> |
boolean |
- |
If set to false will NOT delete stubs from a temporary
folder after running tests.Default value is: true .User property is: deleteStubsAfterTest . |
<excludedFiles> |
List |
- |
Patterns that should not be taken into account for processing. |
<failOnInProgress> |
boolean |
- |
If set to true then if any contracts that are in progress are
found, will break the build. On the producer side you need to be
explicit about the fact that you have contracts in progress and
take into consideration that you might be causing false positive
test execution results on the consumer side. Default value is: true .User property is: failOnInProgress . |
<failOnNoContracts> |
boolean |
- |
When enabled, this flag will tell stub runner to throw an exception
when no stubs / contracts were found. Default value is: true .User property is: failOnNoContracts . |
<generatedTestResourcesDir> |
File |
- |
(no description) Default value is: ${project.build.directory}/generated-test-resources/contracts . |
<generatedTestSourcesDir> |
File |
- |
(no description) Default value is: ${project.build.directory}/generated-test-sources/contracts . |
<ignoredFiles> |
List |
- |
Patterns for which Spring Cloud Contract Verifier should generate
@Ignored tests. |
<imports> |
String[] |
- |
Imports that should be added to generated tests. |
<includedFiles> |
List |
- |
Patterns that should be taken into account for processing. User property is: includedFiles . |
<incrementalContractTests> |
boolean |
- |
If set to true then tests are created only when contracts have
changed since last build. Default value is: true .User property is: incrementalContractTests . |
<mavenTestSkip> |
boolean |
- |
(no description) Default value is: false .User property is: maven.test.skip . |
<nameSuffixForTests> |
String |
- |
(no description) |
<packageWithBaseClasses> |
String |
- |
A package that contains all the base clases for generated tests. If
your contract resides in a location
src/test/resources/contracts/com/example/v1/ and you
provide the packageWithBaseClasses value to
com.example.contracts.base then we will search for a
test source file that will have the package
com.example.contracts.base and name
ExampleV1Base . As you can see it will take the two
last folders to and attach Base to its name.User property is: packageWithBaseClasses . |
<ruleClassForTests> |
String |
- |
(no description) |
<skip> |
boolean |
- |
(no description) Default value is: false .User property is: spring.cloud.contract.verifier.skip . |
<staticImports> |
String[] |
- |
Static imports that should be added to generated tests. |
<testFramework> |
TestFramework |
- |
(no description) Default value is: JUNIT5 . |
<testMode> |
TestMode |
- |
(no description) Default value is: MOCKMVC . |
boolean
No
spring.cloud.contract.verifier.assert.size
false
java.lang.String
No
.*.com.example.v1..*
->
com.example.SomeBaseClass
When a contract's package
matches the provided regular expression then extending class will
be the one provided in the map - in this case
com.example.SomeBaseClass
.java.util.List
No
baseClassMappings
java.lang.String
No
org.apache.maven.model.Dependency
No
contractDependency
java.io.File
No
spring.cloud.contract.verifier.contractsDirectory
${project.basedir}/src/test/resources/contracts
org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties$StubsMode
No
contractsMode
CLASSPATH
groupid/artifactid
. Example: If groupid
is com.example
and artifactid
is
service
then the resolved path will be
/com/example/artifactid
java.lang.String
No
contractsPath
StubDownloaderBuilder
.java.util.Map
No
contractsProperties
java.lang.String
No
contractsRepositoryPassword
java.lang.String
No
contractsRepositoryProxyHost
java.lang.Integer
No
contractsRepositoryProxyPort
java.lang.String
No
contractsRepositoryUrl
java.lang.String
No
contractsRepositoryUsername
false
will NOT delete stubs from a temporary
folder after running tests.boolean
No
deleteStubsAfterTest
true
java.util.List
No
boolean
No
failOnInProgress
true
boolean
No
failOnNoContracts
true
java.io.File
No
${project.build.directory}/generated-test-resources/contracts
java.io.File
No
${project.build.directory}/generated-test-sources/contracts
java.util.List
No
java.lang.String[]
No
java.util.List
No
includedFiles
boolean
No
incrementalContractTests
true
boolean
No
maven.test.skip
false
java.lang.String
No
src/test/resources/contracts/com/example/v1/
and you
provide the packageWithBaseClasses
value to
com.example.contracts.base
then we will search for a
test source file that will have the package
com.example.contracts.base
and name
ExampleV1Base
. As you can see it will take the two
last folders to and attach Base
to its name.java.lang.String
No
packageWithBaseClasses
java.lang.String
No
boolean
No
spring.cloud.contract.verifier.skip
false
java.lang.String[]
No
org.springframework.cloud.contract.verifier.config.TestFramework
No
JUNIT5
org.springframework.cloud.contract.verifier.config.TestMode
No
MOCKMVC