@Test
public void should_upload_legacy_trust_anchor_rfc8630() throws Exception {

    byte[] rfc8630Tal = Files.readAllBytes(new ClassPathResource("tals/rfc8630/afrinic-https-rsync.tal").getFile().toPath());
    final MockMultipartFile uploadedTal = new MockMultipartFile("file", "afrinic-https-rsync.tal", "application/octet-stream", rfc8630Tal);
    ResultActions result = mvc.perform(
            multipart("/api/trust-anchors/upload")
                    .file(uploadedTal)
                    .accept(MediaType.ALL)
    );
    result
            .andExpect(status().isCreated())
            .andExpect(content().contentType(ValidatorApi.API_MIME_TYPE));
    ApiResponse<TrustAnchorResource> response = addTrustAnchorResponse(result);
    assertThat(response.getData()).isNotNull();
    TrustAnchorResource resource = response.getData();
    Link selfRel = resource.getLinks().getLink("self");
    mvc.perform(
            get(selfRel.getHref())
                    .accept(ValidatorApi.API_MIME_TYPE)
    )
            .andExpect(status().isOk())
            .andExpect(content().contentType(ValidatorApi.API_MIME_TYPE))
            .andExpect(jsonPath("$.data.name").value(uploadedTal.getOriginalFilename()))
            .andExpect(jsonPath("$.data.locations", hasSize(2)));
}