DeploymentService { public boolean isArchiveDeployed(String archiveName, String archiveVersion) { return alienMonitorDao.buildQuery(DeploymentTopology.class).prepareSearch() .setFilters(fromKeyValueCouples("deployed", "true", "dependencies.name", archiveName, "dependencies.version", archiveVersion)).count() > 0; }  Deployment[] getActiveDeployments(); Deployment[] getDeployments(String orchestratorId, String sourceId, String environmentId, int from, int size); FacetedSearchResult searchDeployments(String query, String orchestratorId, String environmentId, String sourceId, int from, int size); Deployment[] getActiveDeployments(String orchestratorId, String sourceId, int from, int size); Deployment get(String id); Deployment getOrfail(String id); Deployment getActiveDeploymentOrFail(String environmentId); Deployment getDeployment(String applicationEnvironmentId); Deployment getActiveDeployment(String applicationEnvironmentId); Deployment getActiveDeploymentOrFail(String topologyId, String orchestratorId); Deployment getActiveDeployment(String orchestratorId, String topologyId); boolean isActiveDeployment(String orchestratorId, String orchestratorDeploymentId); Map<String, String> getCloudActiveDeploymentContexts(String orchestratorId); Deployment[] getOrchestratorActiveDeployments(String orchestratorId); Map<String, Set<String>> getOrchestratorDeploymentIdsByOrchestratorId(String applicationEnvironmentId); void markUndeployed(Deployment deployment); boolean isArchiveDeployed(String archiveName, String archiveVersion); void checkDeploymentUpdateFeasibility(Deployment deployment, DeploymentTopology deploymentTopology);  }
@Test public void isArchiveDeployedTest() { DeploymentTopology deploymentTopology = new DeploymentTopology(); deploymentTopology.setId("id"); deploymentTopology.setDeployed(false); deploymentTopology.setDependencies(Sets.newHashSet(new CSARDependency("toto", "2.0.0"))); alienMonitorDao.save(deploymentTopology); deploymentTopology.setId("id2"); deploymentTopology.setDeployed(true); deploymentTopology.setDependencies(Sets.newHashSet(new CSARDependency("tata", "1.0.0"))); alienMonitorDao.save(deploymentTopology); deploymentTopology.setId("id3"); deploymentTopology.setDeployed(true); deploymentTopology.setDependencies(Sets.newHashSet(new CSARDependency("toto", "1.0.0"))); alienMonitorDao.save(deploymentTopology); Assert.assertFalse(deploymentService.isArchiveDeployed("toto", "2.0.0")); deploymentTopology.setId("id"); deploymentTopology.setDeployed(true); deploymentTopology.setDependencies(Sets.newHashSet(new CSARDependency("toto", "2.0.0"))); alienMonitorDao.save(deploymentTopology); Assert.assertTrue(deploymentService.isArchiveDeployed("toto", "2.0.0")); }