@Test
public void should_respond_500_internal_error_if_error_occurs_while_saving_a_page() throws Exception {

    Page page = aPage().withId("my-page").build();
    Mockito.doThrow(new RepositoryException("exception occurs", new Exception())).when(pageRepository).updateLastUpdateAndSave(page);
    mockMvc
            .perform(
                    put("/rest/pages/my-page").contentType(MediaType.APPLICATION_JSON_VALUE).content(
                            convertObjectToJsonBytes(page)))
            .andExpect(status().isInternalServerError());
}