Package io.helidon.webserver.testsupport
Class RouteMock
- java.lang.Object
-
- io.helidon.webserver.testsupport.RouteMock
-
public class RouteMock extends Object
Provides ability to define mocking of particular routes.
-
-
Constructor Summary
Constructors Constructor Description RouteMock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RouteMockbefore(Handler handler)Executes this handler before first matched handler.TestClientclient(Routing routing)Creates new client with this mock and provided routing.RouteMockreplace(int matchRoutIndex, Handler handler)Replace single matched rout.RouteMockskip(int matchRoutIndex)Skips single matched rout.
-
-
-
Method Detail
-
skip
public RouteMock skip(int matchRoutIndex)
Skips single matched rout.- Parameters:
matchRoutIndex- Index of the matched rout. First matched rout has index0.- Returns:
- updated instance.
-
replace
public RouteMock replace(int matchRoutIndex, Handler handler)
Replace single matched rout.- Parameters:
matchRoutIndex- Index of the matched rout. First matched rout has index0.handler- a new handler.- Returns:
- updated instance.
-
before
public RouteMock before(Handler handler)
Executes this handler before first matched handler. Executed only if some handler is matched.- Parameters:
handler- a handler to execute.- Returns:
- updated instance.
-
client
public TestClient client(Routing routing)
Creates new client with this mock and provided routing.- Parameters:
routing- a routing for the client.- Returns:
- new test client.
-
-