File zip = new File(jar.getPath() + ".zip");
FileUtils.moveFile(jar, zip);
final JarPluginArtifact jarArtifact = new JarPluginArtifact(zip);
JsonManifest jsonMf = new JsonManifestHandler().read(jarArtifact);
PluginArtifact artifact = zipTransformer.convertConventionZipToPluginJar(jsonMf, jarArtifact);
JarFile jarFile = new JarFile(artifact.toFile());
Manifest mf = jarFile.getManifest();
for (Map.Entry<String,String> entry : expectedHeaders.entrySet())
{
assertEquals(entry.getValue(), mf.getMainAttributes().getValue(entry.getKey()));
}
for (String path : source)
{
assertTrue("Cannot find path in final artifact: " + path, artifact.doesResourceExist(path));
}
}