Class MockMvc

java.lang.Object
com.codename1.backend.test.MockMvc

public final class MockMvc extends Object

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 Details

    • MockMvc

      public MockMvc(Backend backend)
      A client for backend, which must be running.
  • Method Details