Class MockMvc
java.lang.Object
com.codename1.backend.test.MockMvc
Calls a running backend's routes in the same process: no socket, no port, the same answer. A request goes through what the listener would have done with it -- the body decoded and refused by the same rules, then sessions, scoped beans, CORS, compression, tracing and metrics -- on the calling thread.
A BackendTest injects one into an @Autowired MockMvc field. A test that
assembles its own server can make one with MockMvc(Backend).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionperform(MockRequestBuilder request) Sends one request and returns what came back, to assert on.
-
Constructor Details
-
MockMvc
A client forbackend, which must be running.
-
-
Method Details
-
perform
Sends one request and returns what came back, to assert on.- Throws:
Exception
-