@Test public void testParseFileWithInvalidName() { assertThatExceptionOfType(ConstraintViolationException.class) .isThrownBy(() -> pypiMetadataParser.parseMetadataFile( new FileInputStream("src/test/resources/org.carlspring.strongbox.util/PKG-INFO-invalid-name"))); }
public PypiPackageInfo parseMetadataFile(InputStream is) throws IllegalAccessException, IOException, ConstraintViolationException { Map<String, String> keyValueMap = generateKeyValueMap(is); PypiPackageInfo packageInfo = populateAnnotatedFields(new PypiPackageInfo(), keyValueMap); pypiPackageInfoValidator.validate(packageInfo); return packageInfo; }
PypiMetadataParser { public PypiPackageInfo parseMetadataFile(InputStream is) throws IllegalAccessException, IOException, ConstraintViolationException { Map<String, String> keyValueMap = generateKeyValueMap(is); PypiPackageInfo packageInfo = populateAnnotatedFields(new PypiPackageInfo(), keyValueMap); pypiPackageInfoValidator.validate(packageInfo); return packageInfo; } }
PypiMetadataParser { public PypiPackageInfo parseMetadataFile(InputStream is) throws IllegalAccessException, IOException, ConstraintViolationException { Map<String, String> keyValueMap = generateKeyValueMap(is); PypiPackageInfo packageInfo = populateAnnotatedFields(new PypiPackageInfo(), keyValueMap); pypiPackageInfoValidator.validate(packageInfo); return packageInfo; }  }
PypiMetadataParser { public PypiPackageInfo parseMetadataFile(InputStream is) throws IllegalAccessException, IOException, ConstraintViolationException { Map<String, String> keyValueMap = generateKeyValueMap(is); PypiPackageInfo packageInfo = populateAnnotatedFields(new PypiPackageInfo(), keyValueMap); pypiPackageInfoValidator.validate(packageInfo); return packageInfo; }  PypiPackageInfo parseMetadataFile(InputStream is); PypiPackageInfo populateAnnotatedFields(PypiPackageInfo object,
                                                   Map<String, String> keyValueMap); }
PypiMetadataParser { public PypiPackageInfo parseMetadataFile(InputStream is) throws IllegalAccessException, IOException, ConstraintViolationException { Map<String, String> keyValueMap = generateKeyValueMap(is); PypiPackageInfo packageInfo = populateAnnotatedFields(new PypiPackageInfo(), keyValueMap); pypiPackageInfoValidator.validate(packageInfo); return packageInfo; }  PypiPackageInfo parseMetadataFile(InputStream is); PypiPackageInfo populateAnnotatedFields(PypiPackageInfo object,
                                                   Map<String, String> keyValueMap);  }