Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #237 from akkie/master
Browse files Browse the repository at this point in the history
Allow to override the parameters of a fake environment
  • Loading branch information
akkie committed Dec 17, 2014
2 parents da87435 + 845b4cd commit 82af259
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions app/com/mohiva/play/silhouette/test/Fakes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ object FakeAuthenticator {
* A fake environment implementation.
*
* @param identity The identity to return inside a Silhouette action.
* @param providers The list of authentication providers.
* @param eventBus The event bus implementation.
* @tparam I The type of the identity.
* @tparam T The type of the authenticator.
*/
case class FakeEnvironment[I <: Identity, T <: Authenticator: TypeTag](identity: I) extends Environment[I, T] {
case class FakeEnvironment[I <: Identity, T <: Authenticator: TypeTag](
identity: I,
providers: Map[String, Provider] = Map(),
eventBus: EventBus = EventBus()) extends Environment[I, T] {

/**
* Gets the identity service implementation.
Expand All @@ -199,18 +204,4 @@ case class FakeEnvironment[I <: Identity, T <: Authenticator: TypeTag](identity:
* @return The authenticator service implementation.
*/
val authenticatorService: AuthenticatorService[T] = FakeAuthenticatorService[T]()

/**
* Gets the list of authentication providers.
*
* @return The list of authentication providers.
*/
val providers: Map[String, Provider] = Map()

/**
* The event bus implementation.
*
* @return The event bus implementation.
*/
val eventBus: EventBus = EventBus()
}

0 comments on commit 82af259

Please sign in to comment.