-
- All Implemented Interfaces:
public final class JSONMockServerJSONMockServeris a wrapper class for Spring's MockRestServiceServer, providing access to the JSONConfig instance discovered through Spring auto-wiring.
-
-
Field Summary
Fields Modifier and Type Field Description private final MockRestServiceServermockRestServiceServerprivate final JSONConfigconfig
-
Constructor Summary
Constructors Constructor Description JSONMockServer(MockRestServiceServer mockRestServiceServer, JSONConfig config)
-
Method Summary
Modifier and Type Method Description final MockRestServiceServergetMockRestServiceServer()final JSONConfiggetConfig()final JSONResponseActionsexpect(RequestMatcher requestMatcher)final JSONResponseActionsexpect(ExpectedCount expectedCount, RequestMatcher requestMatcher)final Unitverify()final Unitverify(Duration timeout)final Unitreset()final JSONResponseActionsmock(ExpectedCount expectedCount, HttpMethod method, URI uri, Function1<JSONMockServerDSL, Unit> block)final JSONResponseActionsmockGet(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)Establish a mock request with the method preset to GET. final JSONResponseActionsmockPost(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)Establish a mock request with the method preset to POST. final JSONResponseActionsmockPut(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)Establish a mock request with the method preset to PUT. final JSONResponseActionsmockDelete(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)Establish a mock request with the method preset to DELETE. final JSONResponseActionsmockPatch(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)Establish a mock request with the method preset to PATCH. -
-
Method Detail
-
getMockRestServiceServer
final MockRestServiceServer getMockRestServiceServer()
-
getConfig
final JSONConfig getConfig()
-
expect
final JSONResponseActions expect(RequestMatcher requestMatcher)
-
expect
final JSONResponseActions expect(ExpectedCount expectedCount, RequestMatcher requestMatcher)
-
mock
final JSONResponseActions mock(ExpectedCount expectedCount, HttpMethod method, URI uri, Function1<JSONMockServerDSL, Unit> block)
-
mockGet
final JSONResponseActions mockGet(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)
Establish a mock request with the method preset to GET.
-
mockPost
final JSONResponseActions mockPost(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)
Establish a mock request with the method preset to POST.
-
mockPut
final JSONResponseActions mockPut(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)
Establish a mock request with the method preset to PUT.
-
mockDelete
final JSONResponseActions mockDelete(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)
Establish a mock request with the method preset to DELETE.
-
mockPatch
final JSONResponseActions mockPatch(ExpectedCount expectedCount, URI uri, Function1<JSONMockServerDSL, Unit> block)
Establish a mock request with the method preset to PATCH.
-
-
-
-