Class AbstractRequestExpectationManager.RequestExpectationGroup
- java.lang.Object
- org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
- Enclosing class:
- AbstractRequestExpectationManager
protected static class AbstractRequestExpectationManager.RequestExpectationGroup extends Object
Helper class to manage a group of remaining expectations.
Constructor Summary
Constructors Modifier Constructor Description protectedRequestExpectationGroup()
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAllExpectations(Collection<RequestExpectation> expectations)RequestExpectationfindExpectation(ClientHttpRequest request)Return a matching expectation, ornullif none match.Set<RequestExpectation>getExpectations()voidreset()Reset all expectations for this group.voidupdate(RequestExpectation expectation)Invoke this for an expectation that has been matched.voidupdateAll(Collection<RequestExpectation> expectations)Deprecated.as of 5.0.3, if favor ofaddAllExpectations(java.util.Collection<org.springframework.test.web.client.RequestExpectation>)
Constructor Detail
RequestExpectationGroup
protected RequestExpectationGroup()
Method Detail
addAllExpectations
public void addAllExpectations(Collection<RequestExpectation> expectations)
getExpectations
public Set<RequestExpectation> getExpectations()
findExpectation
@Nullable public RequestExpectation findExpectation(ClientHttpRequest request) throws IOException
Return a matching expectation, ornullif none match.- Throws:
IOException
update
public void update(RequestExpectation expectation)
Invoke this for an expectation that has been matched.The count of the given expectation is incremented, then it is either stored if remainingCount > 0 or removed otherwise.
updateAll
@Deprecated public void updateAll(Collection<RequestExpectation> expectations)
Deprecated.as of 5.0.3, if favor ofaddAllExpectations(java.util.Collection<org.springframework.test.web.client.RequestExpectation>)Add expectations to this group.
reset
public void reset()
Reset all expectations for this group.