@Override public void disposeContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) { if (!deploymentService.isDeployed(id)) { logger.info("No container with id {} found", id); return;
/** * Test coverage for BZ-1171810. */ @Test public void testDuplicateDeployment() { // pretend any deployment unit is deployed when(deploymentService.isDeployed(anyString())).thenReturn(true); // process a successful build result GAV gav = new GAV("g:a:1"); BuildResults result = new BuildResults(gav); deploymentManager.process(result); // deployment unit with the build result GAV must not be deployed (it has already been deployed) verify(deploymentService, atLeast(1)).isDeployed("g:a:1"); verify(deploymentService, never()).undeploy(any(DeploymentUnit.class)); verify(deploymentService, never()).deploy(any(DeploymentUnit.class)); // check error messages added to the build result assertNotEquals(0, result.getErrorMessages().size()); for (BuildMessage msg : result.getErrorMessages()) { assertTrue(msg.getText(), msg.getText().contains("already deployed")); } } }
buildResults.getGAV().getArtifactId(), buildResults.getGAV().getVersion(), "", "", null, null); if(!deploymentService.isDeployed(id) || (deploymentService.isDeployed(id) && overrideDeploymentsEnabled) || id.contains("SNAPSHOT")){ undeploy(unit);
@Override public void deploy(DeploymentUnitSummary unitSummary) { DeploymentUnit unit = null; if(!deploymentService.isDeployed(unitSummary.getId()) || (deploymentService.isDeployed(unitSummary.getId()) && overrideDeploymentsEnabled) || unitSummary.getId().contains("SNAPSHOT")){ if (unitSummary.getType().equals("kjar")) {