class EmbeddedTwitterServer extends AdminHttpClient with BindDSL with Matchers
EmbeddedTwitterServer allows a com.twitter.server.TwitterServer serving http or thrift endpoints to be started locally (on ephemeral ports) and tested through it's http/thrift interfaces.
Note: All initialization fields are lazy to aid running multiple tests inside an IDE at the same time since IDEs typically "pre-construct" ALL the tests before running each one.
- Alphabetic
- By Inheritance
- EmbeddedTwitterServer
- Matchers
- Explicitly
- MatcherWords
- ShouldVerb
- Tolerance
- Assertions
- TripleEquals
- TripleEqualsSupport
- BindDSL
- AdminHttpClient
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new EmbeddedTwitterServer(twitterServer: Ports, flags: Map[String, String], globalFlags: Map[GlobalFlag[_], String], stage: Stage)
- new EmbeddedTwitterServer(twitterServer: Ports, flags: Map[String, String], stage: Stage)
- new EmbeddedTwitterServer(twitterServer: server.TwitterServer, flags: => Map[String, String] = Map(), args: => Seq[String] = Seq(), waitForWarmup: Boolean = true, stage: Stage = Stage.DEVELOPMENT, useSocksProxy: Boolean = false, defaultRequestHeaders: Map[String, String] = Map(), streamResponse: Boolean = false, verbose: Boolean = false, disableTestLogging: Boolean = false, maxStartupTimeSeconds: Int = 60, failOnLintViolation: Boolean = false, closeGracePeriod: Option[Duration] = None, globalFlags: => Map[GlobalFlag[_], String] = Map(), statsReceiverOverride: Option[StatsReceiver] = None)
- twitterServer
The com.twitter.server.TwitterServer to be started for testing.
- flags
Command line flags (e.g. "foo"->"bar" is translated into -foo=bar). See: com.twitter.app.Flag.
- args
Extra command line arguments.
- waitForWarmup
Once the server is started, wait for server warmup to be completed
- stage
com.google.inject.Stage used to create the server's injector. Since EmbeddedTwitterServer is used for testing, we default to Stage.DEVELOPMENT. This makes it possible to only mock objects that are used in a given test, at the expense of not checking that the entire object graph is valid. As such, you should always have at least one Stage.PRODUCTION test for your service (which eagerly creates all classes at startup)
- useSocksProxy
Use a tunneled socks proxy for external service discovery/calls (useful for manually run external integration tests that connect to external services).
- defaultRequestHeaders
Headers to always send to the embedded server.
- streamResponse
Toggle to not unwrap response content body to allow caller to stream response.
- verbose
Enable verbose logging during test runs.
- disableTestLogging
Disable all logging emitted from the test infrastructure.
- maxStartupTimeSeconds
Maximum seconds to wait for embedded server to start. If exceeded a com.twitter.inject.app.StartupTimeoutException is thrown.
- failOnLintViolation
If server startup should fail due (and thus the test) to a detected lint rule issue after startup.
- closeGracePeriod
An Optional grace period to use instead of the underlying server's
defaultGracePeriodwhen closing the underlying server.- globalFlags
An ordered map of GlobalFlag and the desired value to be set during the scope of the underlying twitterServer's lifecycle. The flags will be applied in insertion order, with the first entry being applied closest to the startup of the twitterServer. In order to ensure insertion ordering, you should use a scala.collection.immutable.ListMap.
- statsReceiverOverride
An optional StatsReceiver implementation that should be bound to the underlying server when testing with an injectable server. By default an injectable server under test will have an InMemoryStatsReceiver implementation bound for the purpose of testing. In some cases, users may want to test using a custom StatsReceiver implementation instead and can provide an instance to use here. For non-injectable servers this can be a shared reference used in the server under test.
Type Members
- final class AWord extends AnyRef
- Definition Classes
- Matchers
- final class AnWord extends AnyRef
- Definition Classes
- Matchers
- sealed class AnyShouldWrapper[T] extends AnyRef
- Definition Classes
- Matchers
- class CheckingEqualizer[L] extends AnyRef
- Definition Classes
- TripleEqualsSupport
- sealed class Collected extends Serializable
- Attributes
- protected
- Definition Classes
- Matchers
- class DecidedByEquality[A] extends Equality[A]
- Definition Classes
- Explicitly
- class DecidedWord extends AnyRef
- Definition Classes
- Explicitly
- class DeterminedByEquivalence[T] extends Equivalence[T]
- Definition Classes
- Explicitly
- class DeterminedWord extends AnyRef
- Definition Classes
- Explicitly
- class Equalizer[L] extends AnyRef
- Definition Classes
- TripleEqualsSupport
- final class HavePropertyMatcherGenerator extends AnyRef
- Definition Classes
- Matchers
- final class KeyWord extends AnyRef
- Definition Classes
- Matchers
- final class PlusOrMinusWrapper[T] extends AnyRef
- Definition Classes
- Tolerance
- final class RegexWord extends AnyRef
- Definition Classes
- Matchers
- final class RegexWrapper extends AnyRef
- Definition Classes
- Matchers
- class ResultOfBeWordForAny[T] extends AnyRef
- Definition Classes
- Matchers
- sealed class ResultOfBeWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfBeWordForCollectedArray[T] extends ResultOfBeWordForCollectedAny[Array[T]]
- Definition Classes
- Matchers
- final class ResultOfCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfContainWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfEndWithWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfEndWithWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfFullyMatchWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfFullyMatchWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfHaveWordForCollectedExtent[A] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfHaveWordForExtent[A] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfIncludeWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfIncludeWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfNotWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfStartWithWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfStartWithWordForString extends AnyRef
- Definition Classes
- Matchers
- final class StringShouldWrapper extends AnyShouldWrapper[String] with org.scalatest.matchers.should.Matchers.StringShouldWrapperForVerb
- Definition Classes
- Matchers
- trait StringShouldWrapperForVerb extends AnyRef
- Definition Classes
- ShouldVerb
- class TheAfterWord extends AnyRef
- Definition Classes
- Explicitly
- final class TheSameInstanceAsPhrase extends AnyRef
- Definition Classes
- Matchers
- final class ValueWord extends AnyRef
- Definition Classes
- Matchers
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def !==[T](right: Spread[T]): TripleEqualsInvocationOnSpread[T]
- Definition Classes
- TripleEqualsSupport
- def !==(right: Null): TripleEqualsInvocation[Null]
- Definition Classes
- TripleEqualsSupport
- def !==[T](right: T): TripleEqualsInvocation[T]
- Definition Classes
- TripleEqualsSupport
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <[T](right: T)(implicit arg0: Ordering[T]): ResultOfLessThanComparison[T]
- Definition Classes
- Matchers
- def <=[T](right: T)(implicit arg0: Ordering[T]): ResultOfLessThanOrEqualToComparison[T]
- Definition Classes
- Matchers
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ===[T](right: Spread[T]): TripleEqualsInvocationOnSpread[T]
- Definition Classes
- TripleEqualsSupport
- def ===(right: Null): TripleEqualsInvocation[Null]
- Definition Classes
- TripleEqualsSupport
- def ===[T](right: T): TripleEqualsInvocation[T]
- Definition Classes
- TripleEqualsSupport
- def >[T](right: T)(implicit arg0: Ordering[T]): ResultOfGreaterThanComparison[T]
- Definition Classes
- Matchers
- def >=[T](right: T)(implicit arg0: Ordering[T]): ResultOfGreaterThanOrEqualToComparison[T]
- Definition Classes
- Matchers
- val EmbeddedName: String
- def a[T](implicit arg0: ClassTag[T]): ResultOfATypeInvocation[T]
- Definition Classes
- Matchers
- val a: AWord
- Definition Classes
- Matchers
- def addAcceptHeader(accept: String, headers: Map[String, String]): Map[String, String]
- Attributes
- protected
- Definition Classes
- AdminHttpClient
- final def addInjectionServiceModule(module: Module): Unit
- Attributes
- protected
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- lazy val adminHostAndPort: String
- def adminHttpServerRoutes: Seq[Route]
- Definition Classes
- AdminHttpClient
- val after: TheAfterWord
- Definition Classes
- Explicitly
- def all(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def all[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def all[K, V, MAP[k, v] <: GenMap[k, v]](xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def all[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def allElementsOf[R](elements: GenTraversable[R]): ResultOfAllElementsOfApplication
- Definition Classes
- Matchers
- def allOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAllOfApplication
- Definition Classes
- Matchers
- def an[T](implicit arg0: ClassTag[T]): ResultOfAnTypeInvocation[T]
- Definition Classes
- Matchers
- val an: AnWord
- Definition Classes
- Matchers
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- macro def assert(condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assert(condition: Boolean)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def assertCleanShutdown(): Unit
Asserts that no NonFatal exception was caught while shutting down the underlying
TwitterServer.Asserts that no NonFatal exception was caught while shutting down the underlying
TwitterServer. If an exception occurred on close of the underlying server it will be thrown here. - macro def assertCompiles(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assertDoesNotCompile(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- def assertHealthy(healthy: Boolean = true): Unit
Assert that the underlying TwitterServer is "healthy".
Assert that the underlying TwitterServer is "healthy". This will attempt to hit the AdminHttpInterface
/healthendpoint and expects an "OK\n" response body.This will throw a org.scalatest.exceptions.TestFailedException if the health assertion fails.
- healthy
what value for health to assert, e.g., to assert that the server is "healthy", assertHealthy(healthy=true), Default is true.
- Note
In almost no case is there a need to assertHealthy(healthy=false) as this would typically equate to the underlying server failing to startup -- which would result in a startup exception. If you want to build a wait-loop for the server to report itself as healthy, it is better to query the admin
/healthendpoint directly using isHealthy.- See also
isHealthy to determine the underlying TwitterServer health without an Exception.
- def assertResult(expected: Any)(actual: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def assertResult(expected: Any, clue: Any)(actual: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def assertStarted(started: Boolean = true): Unit
Assert the underlying TwitterServer has started
- def assertThrows[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T], pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assertTypeError(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assume(condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assume(condition: Boolean)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def atLeast(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def atLeast[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def atLeast[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def atLeast[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def atLeastOneElementOf(elements: GenTraversable[Any]): ResultOfAtLeastOneElementOfApplication
- Definition Classes
- Matchers
- def atLeastOneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAtLeastOneOfApplication
- Definition Classes
- Matchers
- def atMost(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def atMost[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def atMost[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def atMost[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def atMostOneElementOf[R](elements: GenTraversable[R]): ResultOfAtMostOneElementOfApplication
- Definition Classes
- Matchers
- def atMostOneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAtMostOneOfApplication
- Definition Classes
- Matchers
- val be: BeWord
- Definition Classes
- MatcherWords
- def between(from: Int, upTo: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def between[K, V, JMAP[k, v] <: Map[k, v]](from: Int, upTo: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def between[E, C[_]](from: Int, upTo: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def bind[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): TypeDSL[T]
- Definition Classes
- BindDSL
- def bindClass[T, Ann <: Annotation, U <: T](clazz: Class[T], annotationClazz: Class[Ann], instanceClazz: Class[U]): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T, U <: T](clazz: Class[T], annotation: Annotation, instanceClazz: Class[U]): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T, U <: T](clazz: Class[T], instanceClazz: Class[U]): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T, Ann <: Annotation](clazz: Class[T], annotationClazz: Class[Ann], instance: T): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T](clazz: Class[T], annotation: Annotation, instance: T): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T](clazz: Class[T], instance: T): EmbeddedTwitterServer.this.type
- Definition Classes
- EmbeddedTwitterServer → BindDSL
- def bindClass[T](clazz: Class[T]): ClassDSL[T]
- Definition Classes
- BindDSL
- def cancel(cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel(message: String, cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel(message: String)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel()(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def clearStats(): Unit
Clears all metrics of the bound InMemoryStatsReceiver when applicable.
Clears all metrics of the bound InMemoryStatsReceiver when applicable. If access to this method is attempted when a non InMemoryStatsReceiver is provided as a statsReceiverOverride this will throw an IllegalStateException as it is not expected that users call this when providing a custom StatsReceiver implementation via the statsReceiverOverride. Instead, users should prefer to clear stats from their custom StatsReceiver implementation by other means.
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(after: Duration): Unit
Close the EmbeddedTwitterServer with the given timeout.
Close the EmbeddedTwitterServer with the given timeout. This timeout is advisory, giving the callee some leeway, for example to drain clients or finish up other tasks. This closes the underlying TwitterServer, any other Closable instances registered with
closeOnExit, and shuts down the FuturePool used to run the underlying TwitterServer. This method returns when all resources have been fully relinquished. - def close(): Unit
Close the EmbeddedTwitterServer.
Close the EmbeddedTwitterServer. This closes the underlying TwitterServer, any other Closable instances registered with
closeOnExit, and shuts down the FuturePool used to run the underlying TwitterServer. This method returns when all resources have been fully relinquished.- See also
Duration)
- def closeOnExit(closable: Closable): Unit
Add the given Closable to the list of closables to be closed when the EmbeddedTwitterServer is closed
Add the given Closable to the list of closables to be closed when the EmbeddedTwitterServer is closed
- Attributes
- protected
- def closed: Boolean
- Attributes
- protected[inject]
- def combineArgs(): Array[String]
Combine the flags Map with the args String to create an argument list for the underlying embedded TwitterServer main
Combine the flags Map with the args String to create an argument list for the underlying embedded TwitterServer main
- Attributes
- protected[twitter]
- val compile: CompileWord
- Definition Classes
- MatcherWords
- val contain: ContainWord
- Definition Classes
- MatcherWords
- def convertEquivalenceToAToBConstraint[A, B](equivalenceOfB: Equivalence[B])(implicit ev: <:<[A, B]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- def convertEquivalenceToBToAConstraint[A, B](equivalenceOfA: Equivalence[A])(implicit ev: <:<[B, A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertNumericToPlusOrMinusWrapper[T](pivot: T)(implicit arg0: Numeric[T]): PlusOrMinusWrapper[T]
- Definition Classes
- Tolerance
- implicit def convertSymbolToHavePropertyMatcherGenerator(symbol: Symbol)(implicit prettifier: Prettifier, pos: Position): HavePropertyMatcherGenerator
- Definition Classes
- Matchers
- implicit def convertToAnyShouldWrapper[T](o: T)(implicit pos: Position, prettifier: Prettifier): AnyShouldWrapper[T]
- Definition Classes
- Matchers
- def convertToCheckingEqualizer[T](left: T): CheckingEqualizer[T]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertToEqualizer[T](left: T): Equalizer[T]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertToRegexWrapper(o: Regex): RegexWrapper
- Definition Classes
- Matchers
- implicit def convertToStringShouldWrapper(o: String)(implicit pos: Position, prettifier: Prettifier): StringShouldWrapper
- Definition Classes
- Matchers
- implicit def convertToStringShouldWrapperForVerb(o: String)(implicit position: Position): StringShouldWrapperForVerb
- Definition Classes
- ShouldVerb
- def createApiRequest(path: String, method: Method = Method.Get): Request
- Attributes
- protected
- Definition Classes
- AdminHttpClient
- val decided: DecidedWord
- Definition Classes
- Explicitly
- def defaultEquality[A]: Equality[A]
- Definition Classes
- TripleEqualsSupport
- val defaultRequestHeaders: Map[String, String]
- val defined: DefinedWord
- Definition Classes
- MatcherWords
- def definedAt[T](right: T): ResultOfDefinedAt[T]
- Definition Classes
- Matchers
- val determined: DeterminedWord
- Definition Classes
- Explicitly
- def disableLogging: Boolean
- Attributes
- protected
- val empty: EmptyWord
- Definition Classes
- MatcherWords
- val endWith: EndWithWord
- Definition Classes
- MatcherWords
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equal(o: Null): Matcher[AnyRef]
- Definition Classes
- Matchers
- def equal[T](spread: Spread[T]): Matcher[T]
- Definition Classes
- Matchers
- def equal(right: Any): MatcherFactory1[Any, Equality]
- Definition Classes
- MatcherWords
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def every(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def every[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def every[K, V, MAP[k, v] <: Map[k, v]](xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def every[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def exactly(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def exactly[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def exactly[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def exactly[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- val exist: ExistWord
- Definition Classes
- MatcherWords
- def fail(cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail(message: String, cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail(message: String)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail()(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val fullyMatch: FullyMatchWord
- Definition Classes
- MatcherWords
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val have: HaveWord
- Definition Classes
- MatcherWords
- def healthResponse(expectedHealthy: Boolean = true): Try[Response]
- Definition Classes
- AdminHttpClient
- final lazy val httpAdminClient: EmbeddedHttpClient
- Definition Classes
- AdminHttpClient
- def httpAdminPort(): Int
- def httpGetAdmin(path: String, accept: String = null, headers: Map[String, String] = Map(), suppress: Boolean = false, andExpect: Status = Status.Ok, withLocation: String = null, withBody: String = null): Response
- Definition Classes
- AdminHttpClient
- def httpPostAdmin(path: String, accept: String = null, headers: Map[String, String] = Map(), suppress: Boolean = false, andExpect: Status = Status.Ok, withLocation: String = null, withBody: String = null): Response
- Definition Classes
- AdminHttpClient
- lazy val inMemoryStats: InMemoryStatsReceiverUtility
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- lazy val inMemoryStatsReceiver: InMemoryStatsReceiver
Returns the bound InMemoryStatsReceiver when applicable.
Returns the bound InMemoryStatsReceiver when applicable. If access to this member is attempted when a non InMemoryStatsReceiver is provided as a statsReceiverOverride this will throw an IllegalStateException as it is not expected that users call this when providing a custom StatsReceiver implementation via the statsReceiverOverride.
- def inOrder(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfInOrderApplication
- Definition Classes
- Matchers
- def inOrderElementsOf[R](elements: GenTraversable[R]): ResultOfInOrderElementsOfApplication
- Definition Classes
- Matchers
- def inOrderOnly[T](firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfInOrderOnlyApplication
- Definition Classes
- Matchers
- val include: IncludeWord
- Definition Classes
- MatcherWords
- lazy val injectableServer: TwitterServer
- lazy val injector: Injector
- def intercept[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T], pos: Position): T
- Definition Classes
- Assertions
- def isHealthy: Boolean
Determines if the underlying TwitterServer is "healthy".
Determines if the underlying TwitterServer is "healthy". This will attempt to hit the AdminHttpInterface
/healthendpoint and expects an "OK\n" response body.- returns
True is the server is "healthy", False otherwise.
- lazy val isInjectable: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isStarted: Boolean
If the underlying embedded TwitterServer has started.
If the underlying embedded TwitterServer has started.
- returns
True if the server has started, False otherwise.
- val key: KeyWord
- Definition Classes
- Matchers
- val length: LengthWord
- Definition Classes
- MatcherWords
- def logStartup(): Unit
Log that the underlying embedded TwitterServer has started and the location of the AdminHttpInterface
Log that the underlying embedded TwitterServer has started and the location of the AdminHttpInterface
- Attributes
- protected[twitter]
- def lowPriorityTypeCheckedConstraint[A, B](implicit equivalenceOfB: Equivalence[B], ev: <:<[A, B]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- def mainResult: Future[Unit]
Returns the result of running the
nonExitingMainof the underlying TwitterServer in the embedded Future Pool. - val matchPattern: MatchPatternWord
- Definition Classes
- MatcherWords
- def message(expectedMessage: String): ResultOfMessageWordApplication
- Definition Classes
- Matchers
- val name: String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def no(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def no[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def no[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def noElementsOf(elements: GenTraversable[Any]): ResultOfNoElementsOfApplication
- Definition Classes
- Matchers
- def noException(implicit pos: Position): NoExceptionWord
- Definition Classes
- MatcherWords
- def noneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfNoneOfApplication
- Definition Classes
- Matchers
- val not: NotWord
- Definition Classes
- MatcherWords
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def of[T](implicit ev: ClassTag[T]): ResultOfOfTypeInvocation[T]
- Definition Classes
- Matchers
- def oneElementOf(elements: GenTraversable[Any]): ResultOfOneElementOfApplication
- Definition Classes
- Matchers
- def oneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfOneOfApplication
- Definition Classes
- Matchers
- def only(xs: Any*)(implicit pos: Position): ResultOfOnlyApplication
- Definition Classes
- Matchers
- def pending: Assertion with PendingStatement
- Definition Classes
- Assertions
- def pendingUntilFixed(f: => Unit)(implicit pos: Position): Assertion with PendingStatement
- Definition Classes
- Assertions
- def printStats(): Unit
Prints stats from the bound InMemoryStatsReceiver when applicable.
Prints stats from the bound InMemoryStatsReceiver when applicable. If access to this method is attempted when a non InMemoryStatsReceiver is provided as a statsReceiverOverride this will throw an IllegalStateException as it is not expected that users call this when providing a custom StatsReceiver implementation via the statsReceiverOverride. Instead, users should prefer to print stats from their custom StatsReceiver implementation by other means.
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- val readable: ReadableWord
- Definition Classes
- MatcherWords
- val regex: RegexWord
- Definition Classes
- Matchers
- val size: SizeWord
- Definition Classes
- MatcherWords
- val sorted: SortedWord
- Definition Classes
- MatcherWords
- def start(): Unit
Start the underlying TwitterServer.
Start the underlying TwitterServer.
- Note
Start is called in various places to "lazily start the server" as needed.
- val startWith: StartWithWord
- Definition Classes
- MatcherWords
- lazy val statsReceiver: StatsReceiver
Returns the StatsReceiver for the underlying server when applicable
- val streamResponse: Boolean
- final val succeed: Assertion
- Definition Classes
- Assertions
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def the[T](implicit arg0: ClassTag[T], pos: Position): ResultOfTheTypeInvocation[T]
- Definition Classes
- Matchers
- def theSameElementsAs(xs: GenTraversable[_]): ResultOfTheSameElementsAsApplication
- Definition Classes
- Matchers
- def theSameElementsInOrderAs(xs: GenTraversable[_]): ResultOfTheSameElementsInOrderAsApplication
- Definition Classes
- Matchers
- val theSameInstanceAs: TheSameInstanceAsPhrase
- Definition Classes
- Matchers
- def thrownBy(fun: => Any): ResultOfThrownByApplication
- Definition Classes
- Matchers
- def toString(): String
- Definition Classes
- AnyRef → Any
- val typeCheck: TypeCheckWord
- Definition Classes
- MatcherWords
- def typeCheckedConstraint[A, B](implicit equivalenceOfA: Equivalence[A], ev: <:<[B, A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def unconstrainedEquality[A, B](implicit equalityOfA: Equality[A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- lazy val usesInMemoryStatsReceiver: Boolean
- val value: ValueWord
- Definition Classes
- Matchers
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withClue[T](clue: Any)(fun: => T): T
- Definition Classes
- Assertions
- def withLocals(fn: => Unit): Unit
A method that allows for applying com.twitter.util.Local context (e.g.
A method that allows for applying com.twitter.util.Local context (e.g. com.twitter.app.GlobalFlag) scoped to the execution of the underlying twitterServer's lifecycle.
- fn
The main function that will take into account local scope modifications
- Attributes
- protected[twitter]
override protected[twitter] def withLocals(fn: => Unit): Unit = super.withLocals { SomeLocal.let("xyz")(fn) }
- Note
Ordering of com.twitter.util.Local context scoping is important. The scope closest to the
fnparam is going to win, if there are conflicts.
Example: - val writable: WritableWord
- Definition Classes
- MatcherWords
Deprecated Value Members
- def assertCounter(name: String)(callback: (Long) => Boolean): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#counters#assert
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def assertCounter(name: String, expected: Long): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#counters#assert
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def assertGauge(name: String, expected: Float): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#gauges#assert
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def assertStat(name: String, expected: Seq[Float]): Unit
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#stats#assert
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def conversionCheckedConstraint[A, B](implicit equivalenceOfA: Equivalence[A], cnv: (B) => A): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The conversionCheckedConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def convertEquivalenceToAToBConversionConstraint[A, B](equivalenceOfB: Equivalence[B])(implicit ev: (A) => B): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The convertEquivalenceToAToBConversionConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def convertEquivalenceToBToAConversionConstraint[A, B](equivalenceOfA: Equivalence[A])(implicit ev: (B) => A): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The convertEquivalenceToBToAConversionConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def countersMap: SortedMap[String, Long]
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#countersMap directly
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def gaugeMap: SortedMap[String, () => Float]
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#gaugeMap directly
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def getCounter(name: String): Long
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#counters#apply
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def getGauge(name: String): Float
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#gauges#apply
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def getStat(name: String): Seq[Float]
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#stats#apply
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def lowPriorityConversionCheckedConstraint[A, B](implicit equivalenceOfB: Equivalence[B], cnv: (A) => B): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The lowPriorityConversionCheckedConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def printStats(includeGauges: Boolean): Unit
Prints stats from the bound InMemoryStatsReceiver when applicable.
Prints stats from the bound InMemoryStatsReceiver when applicable. If access to this method is attempted when a non InMemoryStatsReceiver is provided as a statsReceiverOverride this will throw an IllegalStateException as it is not expected that users call this when providing a custom StatsReceiver implementation via the statsReceiverOverride.
Instead users should prefer to print stats from their custom StatsReceiver implementation by other means.
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use printStats(). The
includeGaugesparameter is ignored and gauge values will now always be printed from the underlying InMemoryStatsReceiver.- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.
- def statsMap: SortedMap[String, Seq[Float]]
- Annotations
- @deprecated
- Deprecated
(Since version 2019-05-17) Use the inMemoryStatsReceiverUtility#statsMap directly
- Exceptions thrown
IllegalStateExceptionwhen a non InMemoryStatsReceiver is provided as a statsReceiverOverride.