@Test
public void should_return_error_response_when_page_is_not_found() throws Exception {

    when(pageRepository.get("unexisting-page")).thenThrow(new NotFoundException("page not found"));
    ResponseEntity<String> response = previewer.render("unexisting-page", pageRepository, request);
    assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
    assertThat(response.getBody()).isEqualTo("Page <unexisting-page> not found");
}