@Test
public void getRecordAsZip() throws Exception {

    final String zipMagicNumber = "PK\u0003\u0004";
    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    MockHttpSession mockHttpSession = loginAsAdmin();
    mockMvc.perform(get("/srv/api/records/" + this.uuid + "/formatters/zip")
        .session(mockHttpSession)
        .accept("application/zip"))
        .andDo(print())
        .andExpect(status().isOk())
        .andExpect(content().contentType(MEF_V2_ACCEPT_TYPE))
        .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION,
            equalTo(String.format("inline; filename=\"%s.%s\"", this.uuid, "zip"))))
        .andExpect(content().string(startsWith(zipMagicNumber)));
    mockMvc.perform(get("/srv/api/records/" + this.uuid + "/formatters/zip")
        .session(mockHttpSession)
        .accept(MEF_V1_ACCEPT_TYPE))
        .andDo(print())
        .andExpect(status().isOk())
        .andExpect(content().contentType(MEF_V1_ACCEPT_TYPE))
        .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION,
            equalTo(String.format("inline; filename=\"%s.%s\"", this.uuid, "zip"))))
        .andExpect(content().string(startsWith(zipMagicNumber)));
    mockMvc.perform(get("/srv/api/records/" + this.uuid + "/formatters/zip")
        .session(mockHttpSession)
        .accept(MEF_V1_ACCEPT_TYPE))
        .andDo(print())
        .andExpect(status().isOk())
        .andExpect(content().contentType(MEF_V1_ACCEPT_TYPE))
        .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION,
            equalTo(String.format("inline; filename=\"%s.%s\"", this.uuid, "zip"))))
        .andExpect(content().string(startsWith(zipMagicNumber)));
}