SyntaxHighlighter

Thursday, March 28, 2013

Mockito Pointers

Mockito Pointers

here's a couple of pointers on Mockito that i don't want to lose;

mock something


   ServletContext servletContext = mock(ServletContext.class);


control the response


    when(servletContext.getContextPath()).thenReturn("some value");


when you don't know the argument value


  when(servletContext.getRealPath(anyObject()).thenReturn("something");

No comments:

Post a Comment