title: java.lang.AssertionError: in Mockito. How to fix it?
body: <pre><code>public void someMethod() throws Exception {
          // null 
          when(request.getParameter("abc")).thenReturn(null);
  
          try {
              abc.manageIncome(request, response, nancy, null);
              fail();
          } catch(IllegalArgumentException ex) {}
  
          verify(nancy.manageIncome(request, response, nancy, "abc"));
      }
  </code></pre>
  
  <p>I get the following error: <code>java.lang.AssertionError</code>.</p>
  
  <p>How to fix it? I am using Mockito.</p>