ArmApplicationDeployer implements Deployer { @Override public void deploy() throws DeploymentException { Integer applicationId = armArtifactDeployer.getApplicationId(); if (applicationId == null) { armArtifactDeployer.deployApplication(); } else { armArtifactDeployer.redeployApplication(); } } ArmApplicationDeployer(Deployment deployment, DeployerLog log); protected  ArmApplicationDeployer(ArmArtifactDeployer deployer, DeployerLog log); @Override void deploy(); @Override void undeploy();  }
@Test public void deployNonExistentApplication() throws DeploymentException { when(artifactDeployerMock.getApplicationId()).thenReturn(null); applicationDeployer.deploy(); verify(artifactDeployerMock, times(1)).deployApplication(); verify(artifactDeployerMock, times(0)).redeployApplication(); }
@Test public void deployExistentApplication() throws DeploymentException { when(artifactDeployerMock.getApplicationId()).thenReturn(FAKE_APPLICATION_NUMBER); applicationDeployer.deploy(); verify(artifactDeployerMock, times(0)).deployApplication(); verify(artifactDeployerMock, times(1)).redeployApplication(); }