@Test
public void should_respond_404_when_getting_an_unexisting_widget() throws Exception {

    when(widgetService.get("notExistingWidget")).thenThrow(new NotFoundException("not found"));
    mockMvc.perform(get("/rest/widgets/notExistingWidget"))
            .andExpect(status().isNotFound());
}