ConfigTestKit

csw.testkit.ConfigTestKit
See theConfigTestKit companion object
final class ConfigTestKit

ConfigTestKit supports starting HTTP Config Server backed by SVN and registering it with location service

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()

Attributes

Companion
object
Graph
Supertypes
trait MockitoSugar
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

useful for deleting entire svn repo when test has finished

useful for deleting entire svn repo when test has finished

Attributes

def initSvnRepo(): Unit

WARNING: use this method only when you are sure that config server is up and running For example: When you start config server using ScalaTestFrameworkTestKit(ConfigServer), you might want to init svn repo explicitly

WARNING: use this method only when you are sure that config server is up and running For example: When you start config server using ScalaTestFrameworkTestKit(ConfigServer), you might want to init svn repo explicitly

Attributes

Shutdown HTTP Config server

Shutdown HTTP Config server

When the test has completed, make sure you shutdown config server.

Attributes

Start HTTP Config server on provided port in constructor or configuration and create clean copy of SVN repo

Start HTTP Config server on provided port in constructor or configuration and create clean copy of SVN repo

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 csw.config.api.scaladsl.ConfigClientService or csw.config.api.scaladsl.ConfigService which can be created via ConfigClientFactory

Attributes

terminate HTTP ConfigServer

terminate HTTP ConfigServer

Attributes

Inherited methods

def mock[T <: AnyRef](name: String)(implicit classTag: ClassTag[T]): T

Invokes the mock(classToMock: Class[T], name: String) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, java.lang.String name) method in Java class org.mockito.Mockito).

Invokes the mock(classToMock: Class[T], name: String) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, java.lang.String name) method in Java class org.mockito.Mockito).

Using the Mockito API directly, you create a mock with:

val mockCollaborator = mock(classOf[Collaborator], name)

Using this method, you can shorten that to:

val mockCollaborator = mock[Collaborator](name)

Attributes

Inherited from:
MockitoSugar
def mock[T <: AnyRef](mockSettings: MockSettings)(implicit classTag: ClassTag[T]): T

Invokes the mock(classToMock: Class[T], mockSettings: MockSettings) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, org.mockito.MockSettings mockSettings) method in Java class org.mockito.Mockito).

Invokes the mock(classToMock: Class[T], mockSettings: MockSettings) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, org.mockito.MockSettings mockSettings) method in Java class org.mockito.Mockito).

Using the Mockito API directly, you create a mock with:

val mockCollaborator = mock(classOf[Collaborator], mockSettings)

Using this method, you can shorten that to:

val mockCollaborator = mock[Collaborator](mockSettings)

Attributes

Inherited from:
MockitoSugar
def mock[T <: AnyRef](defaultAnswer: Answer[_])(implicit classTag: ClassTag[T]): T

Invokes the mock(classToMock: Class[T], defaultAnswer: Answer[_]) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, org.mockito.stubbing.Answer defaultAnswer) method in Java class org.mockito.Mockito).

Invokes the mock(classToMock: Class[T], defaultAnswer: Answer[_]) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock, org.mockito.stubbing.Answer defaultAnswer) method in Java class org.mockito.Mockito).

Using the Mockito API directly, you create a mock with:

val mockCollaborator = mock(classOf[Collaborator], defaultAnswer)

Using this method, you can shorten that to:

val mockCollaborator = mock[Collaborator](defaultAnswer)

Attributes

Inherited from:
MockitoSugar
def mock[T <: AnyRef](implicit classTag: ClassTag[T]): T

Invokes the mock(classToMock: Class[T]) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock) method in Java class org.mockito.Mockito).

Invokes the mock(classToMock: Class[T]) method on the Mockito companion object (i.e., the static mock(java.lang.Class classToMock) method in Java class org.mockito.Mockito).

Using the Mockito API directly, you create a mock with:

val mockCollaborator = mock(classOf[Collaborator])

Using this method, you can shorten that to:

val mockCollaborator = mock[Collaborator]

Attributes

Inherited from:
MockitoSugar

Inherited fields

Attributes

Inherited from:
MockedAuthentication (hidden)
val policyValidator: PolicyValidator

Attributes

Inherited from:
MockedAuthentication (hidden)
val tokenValidator: TokenValidator

Attributes

Inherited from:
MockedAuthentication (hidden)

Implicits

Implicits

implicit lazy val actorSystem: ActorSystem[Command]
implicit lazy val ec: ExecutionContextExecutor
implicit lazy val timeout: Timeout