BundleImpl implements Bundle { @Override public void deploy() throws IOException { PROFILER.startDebug("Deploying bundle"); LOG.debug("Deploying eslint-bridge into {}", deployLocation); InputStream bundle = getClass().getResourceAsStream(bundleLocation); if (bundle == null) { throw new IllegalStateException("eslint-bridge not found in plugin jar"); } BundleUtils.extractFromClasspath(bundle, deployLocation); PROFILER.stopDebug(); } BundleImpl(TempFolder tempFolder);   BundleImpl(TempFolder tempFolder, String bundleLocation); @Override void deploy(); @Override String startServerScript(); @Override String resolve(String relativePath);  }
@Test public void should_not_fail_when_deployed_twice() throws Exception { BundleImpl bundle = new BundleImpl(tempFolder, "/test-bundle.tgz"); bundle.deploy(); bundle.deploy(); }