Pact Contract (#188)
with this change we're providing support for Pact based contracts. No longer do you have to set up your contracts using the Groovy DSL. In the same way as with the DSL you can use the Pact contracts to generate tests and the stubs on the producer side. fixes #96
This commit is contained in:
committed by
GitHub
parent
da6046f342
commit
22a5e44471
@@ -31,7 +31,7 @@ import org.springframework.cloud.contract.spec.internal.Response
|
||||
*/
|
||||
@TypeChecked
|
||||
@EqualsAndHashCode
|
||||
@ToString(includeFields = true, includePackage = false, includeNames = true)
|
||||
@ToString(includePackage = false, includeNames = true)
|
||||
class Contract {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ package org.springframework.cloud.contract.spec
|
||||
* @author Marcin Grzejszczak
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public interface ContractConverter<T> {
|
||||
interface ContractConverter<T> {
|
||||
|
||||
/**
|
||||
* Should this file be accepted by the converter. Can use the file extension
|
||||
|
||||
@@ -25,7 +25,7 @@ import groovy.transform.ToString
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ToString(includePackage = false, includeFields = true, includeNames = true, includeSuper = true)
|
||||
@ToString(includePackage = false, includeNames = true, includeSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@CompileStatic
|
||||
class Body extends DslProperty {
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.contract.spec.internal
|
||||
|
||||
import groovy.transform.CompileStatic
|
||||
import groovy.transform.EqualsAndHashCode
|
||||
import groovy.transform.ToString
|
||||
|
||||
/**
|
||||
* Represents a property that will become an executable method in the
|
||||
@@ -27,6 +28,7 @@ import groovy.transform.EqualsAndHashCode
|
||||
*/
|
||||
@CompileStatic
|
||||
@EqualsAndHashCode
|
||||
@ToString(includePackage = false, includeNames = true)
|
||||
class ExecutionProperty {
|
||||
|
||||
private static final String PLACEHOLDER_VALUE = '\\$it'
|
||||
@@ -46,7 +48,7 @@ class ExecutionProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String toString() {
|
||||
return executionCommand
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import groovy.transform.ToString
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ToString(includePackage = false, includeFields = true, includeNames = true)
|
||||
@ToString(includePackage = false, includeNames = true)
|
||||
@EqualsAndHashCode(includeFields = true)
|
||||
@CompileStatic
|
||||
class NamedProperty {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.cloud.contract.spec.internal
|
||||
|
||||
import groovy.transform.CompileStatic
|
||||
import groovy.transform.ToString
|
||||
|
||||
/**
|
||||
* Represents a property that may or may not be there
|
||||
@@ -24,6 +25,7 @@ import groovy.transform.CompileStatic
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@CompileStatic
|
||||
@ToString(includePackage = false, includeNames = true)
|
||||
class OptionalProperty {
|
||||
final Object value
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import static org.springframework.cloud.contract.spec.util.ValidateUtils.validat
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@EqualsAndHashCode(includeFields = true, callSuper = true)
|
||||
@ToString(includePackage = false, includeFields = true, ignoreNulls = true, includeNames = true, includeSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(includePackage = false, ignoreNulls = true, includeNames = true, includeSuper = true)
|
||||
@CompileStatic
|
||||
class QueryParameter extends DslProperty {
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ import groovy.transform.EqualsAndHashCode
|
||||
import groovy.transform.ToString
|
||||
import groovy.transform.TypeChecked
|
||||
|
||||
@EqualsAndHashCode(includeFields = true)
|
||||
@ToString(includePackage = false, includeFields = true, ignoreNulls = true, includeNames = true)
|
||||
@EqualsAndHashCode
|
||||
@ToString(includePackage = false, ignoreNulls = true, includeNames = true)
|
||||
@TypeChecked
|
||||
class QueryParameters {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.regex.Pattern
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@TypeChecked
|
||||
@EqualsAndHashCode(includeFields = true)
|
||||
@EqualsAndHashCode
|
||||
@ToString(includePackage = false, includeFields = true)
|
||||
class Response extends Common {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import static org.springframework.cloud.contract.spec.util.ValidateUtils.validat
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ToString(includePackage = false, includeFields = true, includeNames = true, includeSuper = true)
|
||||
@ToString(includePackage = false, includeNames = true, includeSuper = true)
|
||||
@EqualsAndHashCode(includeFields = true, callSuper = true)
|
||||
@CompileStatic
|
||||
class Url extends DslProperty {
|
||||
|
||||
@@ -21,7 +21,8 @@ import groovy.transform.EqualsAndHashCode
|
||||
import groovy.transform.ToString
|
||||
|
||||
/**
|
||||
* Represents a url path
|
||||
* Represents a url path. Syntactic sugar when working with
|
||||
* {@link QueryParameters}. It's logically equal to {@link Url}
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user