Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class MockMvc
- Object
- 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).
Constructors
public MockMvc(Backend backend) | A client for backend, which must be running. |
Methods
public ResultActions perform(MockRequestBuilder request)
throws Exception | Sends one request and returns what came back, to assert on. |
Inherited methods
Constructor details
MockMvc
public MockMvc(Backend backend)A client for
backend, which must be running.Method details
perform
public ResultActions perform(MockRequestBuilder request)
throws ExceptionSends one request and returns what came back, to assert on.