class TestInjector extends AnyRef
A com.google.inject.Injector usable for testing. Note, it is expected that construction of the TestInjector happens within a single thread as private state is mutated on creation.
- 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
Instance Constructors
-
new
TestInjector(modules: Seq[Module], flags: Map[String, String] = Map.empty, overrideModules: Seq[Module] = Seq.empty, stage: Stage = Stage.DEVELOPMENT)
- 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.
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bind[T, A <: Annotation](instance: T)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[A]): TestInjector
Bind an instance of type [T] annotated with Annotation type [A] to the object graph of this injector.
Bind an instance of type [T] annotated with Annotation type [A] to the object graph of this injector. This will REPLACE any previously bound instance of the given type bound with the given annotation type.
- T
- type of the instance to bind.
- A
- type of the Annotation used to bind the instance.
- instance
- to bind instance.
- returns
this TestInjector.
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
-
def
bind[T](instance: T)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): TestInjector
Bind an instance of type [T] to the object graph of this injector.
Bind an instance of type [T] to the object graph of this injector. This will REPLACE any previously bound instance of the given type.
- T
- type of the instance to bind.
- instance
- to bind instance.
- returns
this TestInjector.
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
create: Injector
Creates a new com.google.inject.Injector from this TestInjector.
Creates a new com.google.inject.Injector from this TestInjector.
- returns
a new com.google.inject.Injector.
- See also
https://twitter.github.io/finatra/user-guide/testing/index.html#integration-tests
-
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( ... )