@Test
public void testGetCLIFailsOnMalformedXML() throws Exception {

    Attachment cliAttachment = new Attachment("A1", "a.xml");
    when(connector.getAttachmentStream(anyObject(), anyObject(), anyObject())).thenReturn(new ReaderInputStream(new StringReader(CLI_TESTFILE.replaceAll("</Content>", "</Broken>"))));
    LicenseInfoParsingResult res = parser.getLicenseInfos(cliAttachment, new User(), new Project()).stream().findFirst().orElseThrow(()->new RuntimeException("Parser returned empty LisenceInfoParsingResult list"));
    assertLicenseInfoParsingResult(res, LicenseInfoRequestStatus.FAILURE);
    assertThat(res.getStatus(), is(LicenseInfoRequestStatus.FAILURE));
    assertThat(res.getLicenseInfo(), notNullValue());
    assertThat(res.getLicenseInfo().getFilenames(), contains("a.xml"));
}