object TestInjector
A com.google.inject.Injector usable for testing. This injector can be used for
constructing a minimal object graph for use in integration tests. The TestInjector
supports modules, flags, override modules and a bind[T] DSL (for easily replacing
bound instances without using an override module).
Usage is typically through extension of the com.twitter.inject.IntegrationTest (or com.twitter.inject.IntegrationTestMixin) which expects a defined com.google.inject.Injector which can be created by TestInjector#create.
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
- Alphabetic
- By Inheritance
- TestInjector
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(modules: Seq[Module], flags: Map[String, String] = Map.empty, overrideModules: Seq[Module] = Seq.empty, stage: Stage = Stage.DEVELOPMENT): TestInjector
Creates a new TestInjector with the specified params.
Creates a new TestInjector with the specified params.
- modules
- a list of com.google.inject.Module
- flags
- a String Map of flag arguments to set on the injector, default is empty.
- overrideModules
- a list of com.google.inject.Module to use as overrides, default is empty.
- stage
- the com.google.inject.Stage to use, default is DEVELOPMENT.
- returns
a new TestInjector
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
-
def
apply(modules: Module*): TestInjector
Creates a new TestInjector over the given list of com.google.inject.Module
Creates a new TestInjector over the given list of com.google.inject.Module
- modules
- a variable list of com.google.inject.Module
- returns
a new TestInjector
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )