@Test
public void should_generate_html_and_print_it_in_response() throws Exception {

    when(pageRepository.get(page.getId())).thenReturn(page);
    when(generator.generateHtml("/runtime/", page)).thenReturn("foobar");
    ResponseEntity<String> response = previewer.render(page.getId(), pageRepository, request);
    assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(response.getBody()).isEqualTo("foobar");
}