### Question:
LegacyDynamicPluginFactory implements PluginFactory { public Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException { return create(new JarPluginArtifact(deploymentUnit.getPath()), moduleDescriptorFactory); } LegacyDynamicPluginFactory(String pluginDescriptorFileName);  LegacyDynamicPluginFactory(String pluginDescriptorFileName, File tempDirectory); Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory); Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory); String canCreate(PluginArtifact pluginArtifact);  }### Answer:
@Test(expected = PluginParseException.class) public void testCreateCorruptJar() { final LegacyDynamicPluginFactory factory = new LegacyDynamicPluginFactory(PluginAccessor.Descriptor.FILENAME); final Mock mockModuleDescriptorFactory = new Mock(ModuleDescriptorFactory.class); Mock mockArtifact = new Mock(PluginArtifact.class); mockArtifact.expectAndReturn("getResourceAsStream", C.ANY_ARGS, null); mockArtifact.expectAndReturn("toFile", new File("sadfasdf")); factory.create((PluginArtifact) mockArtifact.proxy(), (ModuleDescriptorFactory) mockModuleDescriptorFactory.proxy()); }