-
- All Implemented Interfaces:
@Component() public final class JSONMockMvcReplacement for MockMvc allowing the use of
json-spring-testfunctions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classJSONMockMvc.JSONResultActionspublic final classJSONMockMvc.JSONResultActionsDSL
-
Field Summary
Fields Modifier and Type Field Description private final WebApplicationContextwebApplicationContext
-
Constructor Summary
Constructors Constructor Description JSONMockMvc(JSONConfig autowiredConfig, WebApplicationContext webApplicationContext)
-
Method Summary
Modifier and Type Method Description final WebApplicationContextgetWebApplicationContext()final JSONMockMvc.JSONResultActionsperform(RequestBuilder requestBuilder)Perform a request on the underlying MockMvc. final JSONMockMvc.JSONResultActionsDSLget(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a GET request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLget(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a GET request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLgetForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a GET call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLgetForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a GET call to a MockMvc with the nominated URI, setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLpost(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a POST request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLpost(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a POST request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLpostForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a POST call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLpostForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a POST call to a MockMvc with the nominated URI, setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLput(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a PUT request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLput(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a PUT request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLputForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a PUT call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLputForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a PUT call to a MockMvc with the nominated URI, setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLpatch(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a PATCH request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLpatch(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a PATCH request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLpatchForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a PATCH call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLpatchForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a PATCH call to a MockMvc with the nominated URI, setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLdelete(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a DELETE request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLdelete(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Perform a DELETE request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL. final JSONMockMvc.JSONResultActionsDSLdeleteForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a DELETE call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.final JSONMockMvc.JSONResultActionsDSLdeleteForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)Make a DELETE call to a MockMvc with the nominated URI, setting the Acceptheader toapplication/jsonto indicate that the expected response is JSON.-
-
Method Detail
-
getWebApplicationContext
final WebApplicationContext getWebApplicationContext()
-
perform
final JSONMockMvc.JSONResultActions perform(RequestBuilder requestBuilder)
Perform a request on the underlying MockMvc. This allows the
JSONMockMvcto be used on a similar manner to a MockMvc, for those users who are more familiar with that API.Note, however, that the JSONResultActions returned by this function is similar, but not identical, to the ResultActions returned by the original function.
-
get
final JSONMockMvc.JSONResultActionsDSL get(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a GET request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
get
final JSONMockMvc.JSONResultActionsDSL get(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a GET request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
getForJSON
final JSONMockMvc.JSONResultActionsDSL getForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a GET call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
getForJSON
final JSONMockMvc.JSONResultActionsDSL getForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a GET call to a MockMvc with the nominated URI, setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
post
final JSONMockMvc.JSONResultActionsDSL post(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a POST request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
post
final JSONMockMvc.JSONResultActionsDSL post(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a POST request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
postForJSON
final JSONMockMvc.JSONResultActionsDSL postForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a POST call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
postForJSON
final JSONMockMvc.JSONResultActionsDSL postForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a POST call to a MockMvc with the nominated URI, setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
put
final JSONMockMvc.JSONResultActionsDSL put(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a PUT request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
put
final JSONMockMvc.JSONResultActionsDSL put(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a PUT request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
putForJSON
final JSONMockMvc.JSONResultActionsDSL putForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a PUT call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
putForJSON
final JSONMockMvc.JSONResultActionsDSL putForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a PUT call to a MockMvc with the nominated URI, setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
patch
final JSONMockMvc.JSONResultActionsDSL patch(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a PATCH request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
patch
final JSONMockMvc.JSONResultActionsDSL patch(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a PATCH request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
patchForJSON
final JSONMockMvc.JSONResultActionsDSL patchForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a PATCH call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
patchForJSON
final JSONMockMvc.JSONResultActionsDSL patchForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a PATCH call to a MockMvc with the nominated URI, setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
delete
final JSONMockMvc.JSONResultActionsDSL delete(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a DELETE request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
delete
final JSONMockMvc.JSONResultActionsDSL delete(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Perform a DELETE request, providing access to JSONMockHttpServletRequestDSL Kotlin DSL.
-
deleteForJSON
final JSONMockMvc.JSONResultActionsDSL deleteForJSON(String urlTemplate, Object uriVars, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a DELETE call to a MockMvc with the nominated URL (created from a URL template string and an optional set of variables), setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
deleteForJSON
final JSONMockMvc.JSONResultActionsDSL deleteForJSON(URI uri, Function1<JSONMockHttpServletRequestDSL, Unit> dsl)
Make a DELETE call to a MockMvc with the nominated URI, setting the
Acceptheader toapplication/jsonto indicate that the expected response is JSON. Further details may be added to the request with the optional configuration lambda.
-
-
-
-