title: Mocking in Play! and Scala
body: <p>I have an issue with mocking in a Play application. I have an Application as follows:  </p>
  
  <pre><code>object Application extends Controller {
      def login = Action {implicit request =&gt;
          val email = ... //Some email from the request
          if(EmailChecker.checkEmail(email)) {
              Ok("Email is checked and is fine")
          } else {
              Ok("Email is wrong")
          }
      }
  }
  </code></pre>
  
  <p>What I want to do is to test a request but mock away the EmailChecker becasue it does some lookup in some database and that is not something I want to do in my test.</p>
  
  <p>I have seen some tutorials on how to mock in Scala but I cannot find anything that covers the case I have. </p>
  
  <p>Any help/pointers/tutorials that show how to do what I want to do would be great.  </p>
  
  <p>I am quite new to both Play! and Scala...</p>