title: Test login three times with mockito throws an Exception!
body: <p>I have a test but i am not quite good with it, i want to verify that when the methods login is called three times with wrong username and password it throws an exception is this test correct:</p>
  
  <pre><code>@Test(expected=Login.TooManyLoginException.class)
  public void testLogin_WrongUser_More_Than_Three_Times() {
  
      System.out.println("Testing login With Wrong User More than three Times Method");       
  
      Login mock=mock(Login.class);
  
      when(mock.login(username, password)).thenThrow(new TooManyLoginException("Ha intentado entrar demasiadas veces el programa se cerrara"));
  
      for(int i=0;i&lt;4;i++)
          mock.login(username, password);
  
  }
  </code></pre>
  
  <p>An example might be nice!!</p>