@Test
public void should_list_pages() throws Exception {

    Page page = new Page();
    page.setId("id");
    page.setName("name");
    page.setLastUpdate(Instant.parse("2015-02-02"));
    when(pageRepository.getAll()).thenReturn(Arrays.asList(page));
    mockMvc.perform(get("/rest/pages"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$", hasSize(1)))
            .andExpect(jsonPath("$[*].id").value("id"))
            .andExpect(jsonPath("$[*].name").value("name"))
            .andExpect(jsonPath("$[*].lastUpdate").value(Instant.parse("2015-02-02").getMillis()));
}