  @Test
  public void parse_dummy_report() throws Exception {

    FvdlStAXParser parser = new FvdlStAXParser();
    InputStream inputStream = getClass().getClassLoader().getResourceAsStream("report/dummy-report.xml");
    Fvdl fvdl = parser.parse(inputStream);
    assertThat(fvdl.getBuild().getSourceBasePath()).isEqualTo("/a/dummy/path");
    Collection<Vulnerability> vulnerabilities = fvdl.getVulnerabilities();
    assertThat(vulnerabilities.size()).isEqualTo(3);
    for (Vulnerability vulnerability : vulnerabilities) {
      if ("1".equals(vulnerability.getClassID())) {
        assertThat(vulnerability.getKingdom()).isEqualTo("Code Quality");
        assertThat(vulnerability.getType()).isEqualTo("Unreleased Resource");
        assertThat(vulnerability.getSubtype()).isEqualTo("Database");
        assertThat(vulnerability.getPath()).isEqualTo("dummy.file");
        assertThat(vulnerability.getInstanceID()).isEqualTo("1");
        assertThat(vulnerability.getLine()).isEqualTo(1);
        assertThat(vulnerability.getReplacementDefinitions().size()).isEqualTo(1);
      } else if ("2".equals(vulnerability.getClassID())) {
        assertThat(vulnerability.getKingdom()).isEqualTo("Input Validation and Representation");
        assertThat(vulnerability.getType()).isEqualTo("Command Injection");
        assertThat(vulnerability.getSubtype()).isNull();
        assertThat(vulnerability.getPath()).isNull();
        assertThat(vulnerability.getInstanceID()).isEqualTo("2");
        assertThat(vulnerability.getLine()).isNull();
        assertThat(vulnerability.getReplacementDefinitions().size()).isEqualTo(0);
      } else if ("3".equals(vulnerability.getClassID())) {
        assertThat(vulnerability.getPath()).isNull();
        assertThat(vulnerability.getInstanceID()).isEqualTo("3");
        assertThat(vulnerability.getLine()).isNull();
        assertThat(vulnerability.getReplacementDefinitions().size()).isEqualTo(0);
      } else {
        fail("Vulnerability with classID=" + vulnerability.getClassID() + " is not expected!");
      }
    }
  }