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 protected
RequestExpectationGroup()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestExpectation
findExpectation(ClientHttpRequest request)
Return a matching expectation, ornull
if none match.Set<RequestExpectation>
getExpectations()
void
reset()
Reset all expectations for this group.void
update(RequestExpectation expectation)
Invoke this for an expectation that has been matched.void
updateAll(Collection<RequestExpectation> expectations)
Collection variant ofupdate(RequestExpectation)
that can be used to insert expectations.
Constructor Detail
RequestExpectationGroup
protected RequestExpectationGroup()
Method Detail
getExpectations
public Set<RequestExpectation> getExpectations()
findExpectation
public RequestExpectation findExpectation(ClientHttpRequest request) throws IOException
Return a matching expectation, ornull
if none match.- Throws:
IOException
update
public void update(RequestExpectation expectation)
Invoke this for an expectation that has been matched.The given expectation will either be stored if it has a remaining count or it will be removed otherwise.
updateAll
public void updateAll(Collection<RequestExpectation> expectations)
Collection variant ofupdate(RequestExpectation)
that can be used to insert expectations.
reset
public void reset()
Reset all expectations for this group.