topInstance = new UserService("myUserService") val topInstance = new UserService("myUserService")(ProjectConfiguration) trait ProjectBindings { implicit val bindingModule: BindingModule = ProjectConfiguration } class MyApp extends Injectable with ProjectBindings { // ... }
topInstance = new UserService("myUserService") val topInstance = new UserService("myUserService")(ProjectConfiguration) class SomePage(implicit val bindingModule: BindingModule) extends WicketPage with Injectable { } class ProdSomePage extends SomePage(ProjectConfiguration) trait ProjectBindings { implicit val bindingModule: BindingModule = ProjectConfiguration } class MyApp extends Injectable with ProjectBindings { // ... }
new calls to bind inside here module } val service = new UserService(“myOtherService”)(testConfig) test(”SubCut scalatest test 2") { // testcode using service goes here } test(”SubCut scalatest test 1") { ProjectConfiguration.modifyBindings { module => // new calls to bind inside here val service = new UserService("myUserService")(module) // all testcode using service also goes inside here } }
= new UserService("myMergedService")(testModule) test(”SubCut scalatest test 3") { // testcode using mergedService goes here } val testConfig = ProjectConfiguration.modifyBindings { module => // new calls to bind inside here module } val service = new UserService(“myOtherService”)(testConfig) test(”SubCut scalatest test 2") { // testcode using service goes here } test(”SubCut scalatest test 1") { ProjectConfiguration.modifyBindings { module => // new calls to bind inside here val service = new UserService("myUserService")(module) // all testcode using service also goes inside here } }