ProcessEntryDeployer implements ApplicationEntryDeployer { @Override public void deployEntries(ApplicationContent application) { List<FileContent> processContents = application.getFileContents(ProcessEntryDiscovery.PROCESSES); DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name("ApplicationAutoDeployment"); for (FileContent processContent : processContents) { deploymentBuilder.addBytes(processContent.getName(), processContent.getContent()); } deploymentBuilder.deploy(); } ProcessEntryDeployer(RepositoryService repositoryService); @Override void deployEntries(ApplicationContent application);  }
@Test public void deployEntriesShouldDelegateDeploymentToDeployBuilder() { ApplicationContent applicationContent = new ApplicationContent(); FileContent fileContent = new FileContent("process", "any".getBytes()); applicationContent.add(new ApplicationEntry("processes", fileContent)); DeploymentBuilder deploymentBuilder = mock(DeploymentBuilder.class, Answers.RETURNS_SELF); given(repositoryService.createDeployment()).willReturn(deploymentBuilder); deployer.deployEntries(applicationContent); InOrder inOrder = inOrder(deploymentBuilder); inOrder.verify(deploymentBuilder).addBytes(fileContent.getName(), fileContent.getContent()); inOrder.verify(deploymentBuilder).deploy(); }