public class Contract extends Object
Constructor and Description |
---|
Contract() |
Modifier and Type | Method and Description |
---|---|
static void |
assertContract(Contract dsl) |
void |
description(String description)
Description text.
|
boolean |
equals(Object o) |
String |
getDescription() |
boolean |
getIgnored() |
boolean |
getInProgress() |
Input |
getInput() |
String |
getLabel() |
String |
getName() |
OutputMessage |
getOutputMessage() |
Integer |
getPriority() |
Request |
getRequest() |
Response |
getResponse() |
int |
hashCode() |
void |
ignored()
Whether the contract should be ignored or not.
|
void |
inProgress()
Whether the contract is in progress or not.
|
void |
input(groovy.lang.Closure consumer)
The input part of the contract.
|
void |
input(Consumer<Input> consumer)
The input part of the contract.
|
boolean |
isIgnored() |
boolean |
isInProgress() |
void |
label(String label)
Label used by the messaging contracts to trigger a message on the consumer side.
|
static Contract |
make(groovy.lang.Closure closure)
Groovy point of entry to build a contract.
|
static Contract |
make(Consumer<Contract> consumer)
Point of entry to build a contract.
|
void |
name(String name)
Name of the generated test / stub.
|
void |
outputMessage(groovy.lang.Closure consumer)
The output part of the contract.
|
void |
outputMessage(Consumer<OutputMessage> consumer)
The output part of the contract.
|
void |
priority(int priority)
You can set the level of priority of this contract.
|
void |
request(groovy.lang.Closure consumer)
The HTTP request part of the contract.
|
void |
request(Consumer<Request> consumer)
The HTTP request part of the contract.
|
void |
response(groovy.lang.Closure consumer)
The HTTP response part of the contract.
|
void |
response(Consumer<Response> consumer)
The HTTP response part of the contract.
|
void |
setDescription(String description) |
void |
setIgnored(boolean ignored) |
void |
setInProgress(boolean inProgress) |
void |
setInput(Input input) |
void |
setLabel(String label) |
void |
setName(String name) |
void |
setOutputMessage(OutputMessage outputMessage) |
void |
setPriority(Integer priority) |
void |
setRequest(Request request) |
void |
setResponse(Response response) |
String |
toString() |
public void priority(int priority)
priority
- the higher the value the lower the prioritypublic void name(String name)
name
- name of the contractpublic void label(String label)
label
- - name of the label of a messaging contract to triggerpublic void description(String description)
description
- - value of the descriptionpublic static void assertContract(Contract dsl)
public static Contract make(Consumer<Contract> consumer)
consumer
- function to manipulate the contractpublic static Contract make(@DelegatesTo(value=Contract.class) groovy.lang.Closure closure)
closure
- function to manipulate the contractpublic void request(Consumer<Request> consumer)
consumer
- function to manipulate the requestpublic void response(Consumer<Response> consumer)
consumer
- function to manipulate the responsepublic void input(Consumer<Input> consumer)
consumer
- function to manipulate the inputpublic void outputMessage(Consumer<OutputMessage> consumer)
consumer
- function to manipulate the output messagepublic void request(@DelegatesTo(value=Request.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the requestpublic void response(@DelegatesTo(value=Response.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the responsepublic void input(@DelegatesTo(value=Input.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the inputpublic void outputMessage(@DelegatesTo(value=OutputMessage.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the output messagepublic void ignored()
public void inProgress()
public boolean isInProgress()
public Integer getPriority()
public void setPriority(Integer priority)
public Request getRequest()
public void setRequest(Request request)
public Response getResponse()
public void setResponse(Response response)
public String getLabel()
public void setLabel(String label)
public String getDescription()
public void setDescription(String description)
public String getName()
public void setName(String name)
public Input getInput()
public void setInput(Input input)
public OutputMessage getOutputMessage()
public void setOutputMessage(OutputMessage outputMessage)
public boolean getIgnored()
public boolean isIgnored()
public void setIgnored(boolean ignored)
public boolean getInProgress()
public void setInProgress(boolean inProgress)
Copyright © 2016–2019 Spring. All rights reserved.