After migrating my Play (Scala) app to 2.5.3, some tests of my code using ReactiveMongo that once passed now fail in the setup.
Here is my code using ScalaTest:
def fixture(testMethod: (...) => Any) {
implicit val injector = new…
I want to test a WS client with a fake server like it's explained in the Play 2.4 documentation here : https://www.playframework.com/documentation/2.4.x/ScalaTestingWebServiceClients
But I'm doing DI with Scaldi and i'm not able to adapt the Play's…
I'm trying to test an Actor A inside my Play 2.4 application with Scaldi. This actor is calling injectActorRef[B] that I want to mock with a TestKit.TestProbe.
Inside my specs2, I would like to be able to retrieve the probe for mocked B while…
Actually I`m having trouble with getting my actor (router) system to work correctly.
My Setup:
I`m trying to use an akka router within an play controller. For dependency injection I use scaldi.
scaldi module:
class UserDAOModule extends Module {
…
I'm trying to port this repo from Guice to Scaldi. I'm stack in this code from /app/utils/di/SilhouetteModule.scala (lines 60-65):
Map(
credentialsProvider.id -> credentialsProvider,
facebookProvider.id -> facebookProvider,
…
thank you in advance for taking the time to take a look at my current problem with play.
I am still trying out the Playframework, currently in version 2.3.
At the moment I try to figure dependency injection out.
I followed the tutorials provided in…
I tried to upgrade our applications which use Scaldi injection from Play 2.6.12 to Play 2.6.13. On all applications we run into the same problem.
It tries to instantiate an object of type '$$anon$1' or 'play.api.inject.BindingKey$$anon$1@5d807417'…
I would like to inject two different instances of my database wrapper class (DB): a default instance and a readonly instance.
99% of usages of the class use the default instance. I would therefore like to be able to use the simple inject[DB] to get…
I have three classes class A, class B and class C. I want to inject Class A and Class B as a dependency through constructor to Class C. I am using ScalDI dependency injection framework. Can someone tell me how I can do it?
class A {
...}
class B…
I am using Scaldi with Play and Slick in my application.
I need to bind a DatabaseConfig dependency to different configurations depending on some condition.
Mode = Dev => Oracle DB
Mode = UAT => Another Oracle DB
...
Mode = Test => Local H2 DB
No…
Here is the issue. Let assume I have two mutable modules:
class DbModule extends Module { bind[JdbcBackend#Database] toProvider
inject[JdbcDriver].backend.Database.forURL(
inject[String]("db.url"),
inject[String]("db.username"),
…
I want to load my own config from a configuration file. After loading the config I want to be able to inject the config values using Scaldi. Here is the code where I load the typesafe config. How can I adjust this code so that I can use this module…
I have an implicit scaldi Module in my root package object so that any component can use the injector implicitly.
This module looks like this:
val additionalModule = new AtomicReference[Module](new Module {})
lazy val applicationModule =…
I am new to scaldi. I have a class being used in my cloud environment configuration where I want two things to happen.
bind [EnvironmentInfo] to new EnvironmentInfo initWith(_.init())
First, I want it to be a singleton. It retrieves the runtime…
I am following the steps mentioned in Scaldi documentaiton. Following is my code.
class Game(players: List[Player], currentPlayer: Player,
board: Board, active: Boolean, gamePersistor: GamePersistor) extends Injectable {
def…