@Test
public void should_respond_404_not_found_when_delete_inexisting_page() throws Exception {

    doThrow(new NotFoundException("page not found")).when(pageRepository).delete("my-page");
    mockMvc.perform(delete("/rest/pages/my-page")).andExpect(status().isNotFound());
}