I am writing a Rest service using Spring MVC. Here is the outline of the class:
@Controller
public class MyController{
@RequestMapping(..)
public vo
You could change @Test to
@Test(expected=NotAuthorizedException.class)
This would return true if the internals throw up that exception and false otherwise.
This would also make the assertThat() unnecessary. You could write a second test that catches the NotAuthorizedException then you could inspect the responseMock under that condition then.