Class Common
java.lang.Object
org.springframework.cloud.contract.spec.internal.Common
- Direct Known Subclasses:
Input,OutputMessage,Request,Response
Contains useful common methods for the DSL.
- Since:
- 1.0.0
- Author:
- Marcin Grzejszczak, Olga Maciaszek-Sharma, Tim Ysewyn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription$(ClientDslProperty client, ServerDslProperty server) $(DslProperty value) $(ServerDslProperty server, ClientDslProperty client) aDouble()voidassertThatSidesMatch(Object firstSide, Object secondSide) Helper method to provide a better name for the consumer side.Helper method to provide a better name for the consumer side.Helper method to provide a better name for the consumer side.email()Read file contents as String.Read file contents as String with the given Charset.fileAsBytes(String relativePath) Read file contents as bytes[].hostname()httpsUrl()isoDate()isoTime()named(Map<String, DslProperty> namedMap) named(DslProperty name, DslProperty value) named(DslProperty name, DslProperty value, DslProperty contentType) nonBlank()nonEmpty()number()Helper method to provide a better name for the server side.Helper method to provide a better name for the server side.regex(RegexProperty regex) regexProperty(Object object) Helper method to provide a better name for the server side.Helper method to provide a better name for the consumer side.Helper method to provide a better name for the server side.toDslProperty(Object property) toDslProperty(List property) toDslProperty(Map property) toDslProperty(DslProperty property) url()uuid()value(ClientDslProperty client, ServerDslProperty server) value(DslProperty value) value(ServerDslProperty server, ClientDslProperty client)
-
Constructor Details
-
Common
public Common()
-
-
Method Details
-
convertObjectsToDslProperties
-
convertObjectsToDslProperties
-
toDslProperty
-
toDslProperty
-
toDslProperty
-
toDslProperty
-
named
-
named
-
named
-
value
-
$
-
value
-
$
-
value
-
$
-
value
-
$
-
regex
-
regex
-
regex
-
optional
-
regexProperty
-
execute
-
client
Helper method to provide a better name for the consumer side.- Parameters:
clientValue- client value- Returns:
- client dsl property
-
stub
Helper method to provide a better name for the consumer side.- Parameters:
clientValue- client value- Returns:
- client dsl property
-
consumer
Helper method to provide a better name for the consumer side.- Parameters:
clientValue- client value- Returns:
- client dsl property
-
server
Helper method to provide a better name for the server side.- Parameters:
serverValue- server value- Returns:
- server dsl property
-
c
Helper method to provide a better name for the consumer side.- Parameters:
clientValue- client value- Returns:
- client dsl property
-
p
Helper method to provide a better name for the server side.- Parameters:
serverValue- server value- Returns:
- server dsl property
-
test
Helper method to provide a better name for the server side.- Parameters:
serverValue- server value- Returns:
- server dsl property
-
file
Read file contents as String.- Parameters:
relativePath- of the file to read- Returns:
- String file contents
-
fileAsBytes
Read file contents as bytes[].- Parameters:
relativePath- of the file to read- Returns:
- String file contents
-
file
Read file contents as String with the given Charset.- Parameters:
relativePath- of the file to readcharset- to use for converting the bytes to String- Returns:
- String file contents
-
producer
Helper method to provide a better name for the server side.- Parameters:
serverValue- server value- Returns:
- server dsl property
-
assertThatSidesMatch
-
onlyAlphaUnicode
-
alphaNumeric
-
number
-
positiveInt
-
anyBoolean
-
anInteger
-
aDouble
-
ipAddress
-
hostname
-
email
-
url
-
httpsUrl
-
uuid
-
isoDate
-
isoDateTime
-
isoTime
-
iso8601WithOffset
-
nonEmpty
-
nonBlank
-