ServerRule instead.@Deprecated public class ServerRule extends ServerRule
JunitServerRunner is used.
This rule should be used as a ClassRule to start embedded container before all tests and shutdown
after all tests. Here is an example automatic classpath detection:
public class Test {
@ClassRule
public static serverRule = ServerRule();
@Test
public void it_should_have_a_port() {
assertTrue(serverRule.getPort() > 0).
}
}
| Constructor and Description |
|---|
ServerRule()
Deprecated.
Create rule with default embedded server.
|
ServerRule(AbstractConfiguration configuration)
Deprecated.
Create rule with embedded server configuration.
|
ServerRule(EmbeddedServer<?> server)
Deprecated.
Create rule with an embedded server.
|
after, before, getClient, getHost, getPath, getPort, getScheme, getServer, getUrl, isStarted, restart, start, stoppublic ServerRule()
Embedded server implementation is chosen using the service provider interface from the JDK.
The server will automatically use the default configuration,
to specify a custom configuration, use ServerRule(AbstractConfiguration) constructor.
public ServerRule(AbstractConfiguration configuration)
Embedded server implementation is chosen using the service provider interface from the JDK.
configuration - Server configuration.public ServerRule(EmbeddedServer<?> server)
server - Embedded server, not null.NullPointerException - If server is null.Copyright © 2018. All rights reserved.