@Singleton
@Primary
@Requires(property="micronaut.test.server.url") @Requires(missingProperty="micronaut.test.server.executable")
public class TestEmbeddedServer
extends java.lang.Object
implements io.micronaut.runtime.server.EmbeddedServer
EmbeddedServer
implementation that can be enabled by setting micronaut.test.server.url
to run tests against and existing running server.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
TestEmbeddedServer(java.net.URL url,
io.micronaut.runtime.ApplicationConfiguration applicationConfiguration,
io.micronaut.context.ApplicationContext applicationContext)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
io.micronaut.runtime.ApplicationConfiguration |
getApplicationConfiguration() |
io.micronaut.context.ApplicationContext |
getApplicationContext() |
java.lang.String |
getHost() |
int |
getPort() |
java.lang.String |
getScheme() |
java.net.URI |
getURI() |
java.net.URL |
getURL() |
boolean |
isRunning() |
boolean |
isServer() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String PROPERTY
@Internal protected TestEmbeddedServer(@Property(name="micronaut.test.server.url") java.net.URL url, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.context.ApplicationContext applicationContext)
url
- The server URLapplicationConfiguration
- The application configurationapplicationContext
- The application contextpublic int getPort()
getPort
in interface io.micronaut.runtime.server.EmbeddedServer
public java.lang.String getHost()
getHost
in interface io.micronaut.runtime.server.EmbeddedServer
public java.lang.String getScheme()
getScheme
in interface io.micronaut.runtime.server.EmbeddedServer
public java.net.URL getURL()
getURL
in interface io.micronaut.runtime.server.EmbeddedServer
public java.net.URI getURI()
getURI
in interface io.micronaut.runtime.server.EmbeddedServer
public io.micronaut.context.ApplicationContext getApplicationContext()
getApplicationContext
in interface io.micronaut.context.ApplicationContextProvider
getApplicationContext
in interface io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>
public io.micronaut.runtime.ApplicationConfiguration getApplicationConfiguration()
getApplicationConfiguration
in interface io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>
public boolean isRunning()
isRunning
in interface io.micronaut.context.LifeCycle
public boolean isServer()
isServer
in interface io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>
isServer
in interface io.micronaut.runtime.server.EmbeddedServer