public class WervalHttpRule extends Object implements WervalHttpTestSupport, TestRule
Activate/Passivate Werval Application and HTTP Server in test mode around JUnit tests.
Can be used to activate/passivate around each method test as a @Rule
or around each test class as a @ClassRule
.
By default, configuration is loaded from the application.conf
file and routes are loaded from the routes.conf
file.
Use the various constructors to to provide your own test configuration and routes.
Constructor and Description |
---|
WervalHttpRule() |
WervalHttpRule(io.werval.runtime.routes.RoutesProvider routesProvider) |
WervalHttpRule(String configurationResourceName) |
WervalHttpRule(String configurationResourceName, io.werval.runtime.routes.RoutesProvider routesProvider) |
Modifier and Type | Method and Description |
---|---|
ApplicationSPI |
application() |
Statement |
apply(Statement statement, Description description) |
String |
baseHttpUrl() |
String |
httpHost() |
int |
httpPort() |
public WervalHttpRule()
public WervalHttpRule(String configurationResourceName)
public WervalHttpRule(io.werval.runtime.routes.RoutesProvider routesProvider)
public WervalHttpRule(String configurationResourceName, io.werval.runtime.routes.RoutesProvider routesProvider)
public final ApplicationSPI application()
application
in interface
WervalHttpTestSupport
public final String httpHost()
httpHost
in interface
WervalHttpTestSupport
public final int httpPort()
httpPort
in interface
WervalHttpTestSupport
public final String baseHttpUrl()
baseHttpUrl
in interface
WervalHttpTestSupport
public Statement apply(Statement statement, Description description)