@Test
public void getOneRecordExtentAsImage() throws Exception {

    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
    MockHttpSession mockHttpSession = loginAsAdmin();
    String uuid = createTestData();
    byte[] reponseBuffer = mockMvc.perform(get(String.format("/srv/api/records/%s/extents.png", uuid))
        .session(mockHttpSession)
        .accept(MediaType.IMAGE_PNG_VALUE))
        .andExpect(status().is2xxSuccessful())
        .andExpect(content().contentType(API_PNG_EXPECTED_ENCODING))
        .andReturn().getResponse().getContentAsByteArray();
    saveImageToDiskIfConfiguredToDoSo(reponseBuffer, name.getMethodName());
    assertEquals("b02baec6d92832ecd5653db78093a427", DigestUtils.md5DigestAsHex(reponseBuffer));
}