@Test
public void getRecordAsXML() throws Exception {

    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    MockHttpSession mockHttpSession = loginAsAdmin();
    mockMvc.perform(get("/srv/api/records/" + this.uuid + "/formatters/xml")
        .session(mockHttpSession)
        .accept(MediaType.APPLICATION_XML))
        .andDo(print())
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_XML))
        .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION,
            equalTo(String.format("inline; filename=\"%s.%s\"", this.uuid, "xml"))))
        .andExpect(content().string(containsString(this.uuid)))
        .andExpect(xpath("/MD_Metadata/fileIdentifier/CharacterString").string(this.uuid));
    mockMvc.perform(get("/srv/api/records/" + this.uuid + "/formatters/json")
        .session(mockHttpSession)
        .accept(MediaType.APPLICATION_JSON))
        .andDo(print())
        .andExpect(status().isOk())
        .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING))
        .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION,
            equalTo(String.format("inline; filename=\"%s.%s\"", this.uuid, "json"))))
        .andExpect(content().string(containsString(this.uuid)))
        .andExpect(jsonPath("$.['gmd:fileIdentifier'].['gco:CharacterString'].['#text']").value(this.uuid));
}