title: How do I change Guice bindings for functional tests?
body: <p>I'm working on a Play (v. 2.4) application with Guice as DI provider. Everything runs fine however I have a set of functional tests running with ScalaTestPlus and I would like to replace some dependencies when the test are running. The tests are written by extending <code>OneServerPerSuite</code> class as they check my REST API.</p>
  
  <p>Is there any way to have other dependencies during tests?</p>
  
  <p><strong>EDIT: Sample code:</strong></p>
  
  <p>Sample controller:</p>
  
  <pre><code>class UserController @Inject()(userService: UserService) extends AbstractController { ... }
  </code></pre>
  
  <p>And dependecy definition in module:</p>
  
  <pre><code>bind(classOf[UserService]) to (classOf[ProdUserService])
  </code></pre>
  
  <p>My tests are like this:</p>
  
  <pre><code>class ApiTest extends PlaySpec with OneServerPerSuite {
  
      "User API should" must {
           "get User's data" in {
               (...) //calling to an endpoint and verifying response
           }
       }
  }
  </code></pre>
  
  <p>I would like to have <code>ProdUserService</code> replaced with other implementation but only in tests.</p>