Allow plugging in custom RequestExpectationManager

The MockRestServiceServer builder now has an option to plug in a
custom RequestExpectationManager.

Issue: SPR-11365
This commit is contained in:
Rossen Stoyanchev
2016-02-23 10:56:18 -05:00
parent a56c69c9ca
commit 08a08725be
7 changed files with 61 additions and 54 deletions

View File

@@ -34,7 +34,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
* Unit tests for {@link AbstractRequestExpectationManager}.
* @author Rossen Stoyanchev
*/
public class OrderedRequestExpectationManagerTests {
public class SimpleRequestExpectationManagerTests {
private SimpleRequestExpectationManager manager = new SimpleRequestExpectationManager();
@@ -45,7 +45,8 @@ public class OrderedRequestExpectationManagerTests {
this.manager.validateRequest(request(HttpMethod.GET, "/foo"));
}
catch (AssertionError error) {
assertEquals("No further requests expected: HTTP GET /foo", error.getMessage());
assertEquals("No further requests expected: HTTP GET /foo\n" +
"0 out of 0 were executed", error.getMessage());
}
}