DefaultManifestReader implements ManifestReader { Dependency getDependency(String rawDependency) throws ManifestException { String[] nameAndVersion = rawDependency.split(VERSION_DELIMITER); switch (nameAndVersion.length) { case 1: return new DependencyContainer(nameAndVersion[0].trim()); case 2: return new DependencyContainer(nameAndVersion[0].trim(), nameAndVersion[1].trim()); default: throw new ManifestException(String.format("Invalid dependency specification: %s", rawDependency)); } }  @Override PluginMetadata read(Path pluginFile); static final String DEPENDENCY_DELIMITER; static final String VERSION_DELIMITER; static final DateTimeFormatter DATE_FORMATTER; }
@Test(expected = ManifestException.class) public void testGetIncorrectDependency() throws ManifestException { getDependency("some" + VERSION_DELIMITER + "incorrect" + VERSION_DELIMITER + "dependency"); }