test_class.file: kb-importer/src/test/java/org/eclipse/steady/kb/util/MetadataTest.java
test_class.identifier: MetadataTest
test_case.body: @Test
    public void testGetVulnMetadata() throws JsonSyntaxException, IOException {
      ClassLoader classLoader = getClass().getClassLoader();
      String path = classLoader.getResource("testRootDir1").getPath();
      Vulnerability vuln = Metadata.getVulnerabilityMetadata(path);
      assertEquals(3, vuln.getArtifacts().size());
      assertEquals(3, vuln.getNotes().size());
      assertEquals("COLLECTIONS-580", vuln.getVulnId());
    }
test_case.class_method_signature: MetadataTest.testGetVulnMetadata()
test_case.full_signature: @Test public void testGetVulnMetadata()
test_case.identifier: testGetVulnMetadata
test_case.invocations: getClassLoader getClass getPath getResource getVulnerabilityMetadata assertEquals size getArtifacts assertEquals size getNotes assertEquals getVulnId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetVulnMetadata()
focal_class.declarator: META_PROPERTIES_FILE = "metadata.json"
focal_class.modifier: private static final
focal_class.original_string: private static final String META_PROPERTIES_FILE = "metadata.json";
focal_class.type: String
focal_class.var_name: META_PROPERTIES_FILE
focal_class.declarator: log = org.apache.logging.log4j.LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: kb-importer/src/main/java/org/eclipse/steady/kb/util/Metadata.java
focal_class.identifier: Metadata
focal_class.class_method_signature: Metadata.getCommitMetadata(String commitDir)
focal_class.full_signature: public static Commit getCommitMetadata(String commitDir)
focal_class.identifier: getCommitMetadata
focal_class.modifiers: public static
focal_class.parameters: (String commitDir)
focal_class.return: Commit
focal_class.signature: Commit getCommitMetadata(String commitDir)
focal_class.class_method_signature: Metadata.getVulnerabilityMetadata(String rootDir)
focal_class.full_signature: public static Vulnerability getVulnerabilityMetadata(String rootDir)
focal_class.identifier: getVulnerabilityMetadata
focal_class.modifiers: public static
focal_class.parameters: (String rootDir)
focal_class.return: Vulnerability
focal_class.signature: Vulnerability getVulnerabilityMetadata(String rootDir)
focal_method.body: public static Vulnerability getVulnerabilityMetadata(String rootDir)
        throws JsonSyntaxException, IOException {
      String filePath = rootDir + File.separator + META_PROPERTIES_FILE;
      if (!FileUtil.isAccessibleFile(filePath)) {
        throw new IllegalArgumentException(
            "The root folder "
                + rootDir
                + "  or the meta file in root directory is missing "
                + filePath);
      }
  
      Gson gson = new Gson();
      Vulnerability metadata = null;
      metadata = gson.fromJson(FileUtil.readFile(filePath), Vulnerability.class);
  
      if (StringUtils.isBlank(metadata.getVulnId())) {
        throw new IllegalArgumentException(
            "The vulnerability_id is missing missing in the " + filePath + " file");
      }
  
      return metadata;
    }
focal_method.class_method_signature: Metadata.getVulnerabilityMetadata(String rootDir)
focal_method.full_signature: public static Vulnerability getVulnerabilityMetadata(String rootDir)
focal_method.identifier: getVulnerabilityMetadata
focal_method.invocations: isAccessibleFile fromJson readFile isBlank getVulnId
focal_method.modifiers: public static
focal_method.parameters: (String rootDir)
focal_method.return: Vulnerability
focal_method.signature: Vulnerability getVulnerabilityMetadata(String rootDir)