public final class ConfigTestKit
extends java.lang.Object
Example:
private val testKit = ConfigTestKit()
// starting Config Server (starts config server on default ports specified in configuration file)
// it will also register ConfigService with location service
testKit.startConfigServer()
// stopping Config Server
testKit.shutdownConfigServer()
Modifier and Type | Method and Description |
---|---|
akka.actor.ActorSystem |
actorSystem() |
static ConfigTestKit |
apply(akka.actor.ActorSystem actorSystem,
scala.Option<com.typesafe.config.Config> serverConfig,
TestKitSettings testKitSettings)
Create a ConfigTestKit
|
csw.config.server.ServerWiring |
configWiring() |
static ConfigTestKit |
create(akka.actor.ActorSystem actorSystem)
Java API for creating ConfigTestKit
|
static ConfigTestKit |
create(com.typesafe.config.Config serverConfig)
Java API for creating ConfigTestKit
|
static ConfigTestKit |
create(com.typesafe.config.Config serverConfig,
TestKitSettings testKitSettings)
Java API for creating ConfigTestKit
|
static ConfigTestKit |
create(TestKitSettings testKitSettings)
Java API for creating ConfigTestKit
|
void |
deleteServerFiles()
useful for deleting entire svn repo when test has finished
|
scala.concurrent.ExecutionContextExecutor |
ec() |
akka.stream.Materializer |
mat() |
void |
shutdownConfigServer()
Shutdown HTTP Config server
|
void |
startConfigServer()
Start HTTP Config server on provided port in constructor or configuration and create clean copy of SVN repo
|
void |
terminateServer()
terminate HTTP ConfigServer
|
akka.util.Timeout |
timeout() |
public static ConfigTestKit apply(akka.actor.ActorSystem actorSystem, scala.Option<com.typesafe.config.Config> serverConfig, TestKitSettings testKitSettings)
When the test has completed you should shutdown the config server
with shutdownConfigServer()
.
actorSystem
- (undocumented)serverConfig
- (undocumented)testKitSettings
- (undocumented)public static ConfigTestKit create(akka.actor.ActorSystem actorSystem)
actorSystem
- public static ConfigTestKit create(com.typesafe.config.Config serverConfig)
serverConfig
- custom configuration with which to start config serverpublic static ConfigTestKit create(TestKitSettings testKitSettings)
testKitSettings
- custom testKitSettingspublic static ConfigTestKit create(com.typesafe.config.Config serverConfig, TestKitSettings testKitSettings)
serverConfig
- custom configuration with which to start config servertestKitSettings
- custom testKitSettingspublic akka.actor.ActorSystem actorSystem()
public csw.config.server.ServerWiring configWiring()
public scala.concurrent.ExecutionContextExecutor ec()
public akka.stream.Materializer mat()
public akka.util.Timeout timeout()
public void startConfigServer()
If your test's requires accessing/creating configurations from configuration service, then using this method you can start configuration service.
Configuration service can be accessed via ConfigClientService
or ConfigService
which can be created via csw.config.client.scaladsl.ConfigClientFactory
public void deleteServerFiles()
public void terminateServer()
public void shutdownConfigServer()
When the test has completed, make sure you shutdown config server.