### Question:
ProcessDefinitionDeployerImpl implements ProcessDefinitionDeployer { @Override public void deployProcessDefinitions(String bundleSymbolicName, List<URL> pathList) { try { LOGGER.log(Level.FINE, "Found process in bundle " + bundleSymbolicName + " with paths: " + pathList); if (engine == null) { throw new IllegalStateException( "Unable to find a ProcessEngine service"); } RepositoryService service = engine.getRepositoryService(); DeploymentBuilder builder = service.createDeployment(); builder.name(bundleSymbolicName); for (URL url : pathList) { InputStream is = url.openStream(); if (is == null) { throw new IOException("Error opening url: " + url); } try { builder.addInputStream(getPath(url), is); } finally { is.close(); } } builder.enableDuplicateFiltering(true); builder.deploy(); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to deploy bundle", e); } } ProcessDefinitionDeployerImpl();  ProcessDefinitionDeployerImpl(ProcessEngine engine); @Override void deployProcessDefinitions(String bundleSymbolicName, List<URL> pathList);  }### Answer:
@Test public void deployEmptyPathList() { ProcessDefinitionDeployer deployer = new ProcessDefinitionDeployerImpl( createProcessEngineMock()); deployer.deployProcessDefinitions("test bundle", Collections.<URL> emptyList()); verify(deploymentBuilder).deploy(); }
@Test public void deploySingleProcess() throws MalformedURLException { ProcessDefinitionDeployer deployer = new ProcessDefinitionDeployerImpl( createProcessEngineMock()); URL url = new File("src/test/resources/testprocess.bpmn").toURI() .toURL(); deployer.deployProcessDefinitions("test bundle", Collections.singletonList(url)); verify(deploymentBuilder).deploy(); verify(deploymentBuilder).addInputStream(eq(url.toString()), any(InputStream.class)); }
@Test public void throwsExceptionWhenProcessEngineNotFound() { ProcessDefinitionDeployer deployer = new ProcessDefinitionDeployerImpl( null); deployer.deployProcessDefinitions("test bundle", null); }