List<DeploymentStatistics> statistics =
managementService.createDeploymentStatisticsQuery().includeFailedJobs().list();
Assert.assertEquals(1, statistics.size());
DeploymentStatistics result = statistics.get(0);
Assert.assertEquals(2, result.getInstances());
Assert.assertEquals(0, result.getFailedJobs());
Assert.assertEquals(deployment.getId(), result.getId());
Assert.assertEquals(deploymentName, result.getName());
// only compare time on second level (i.e. drop milliseconds)
Calendar cal1 = Calendar.getInstance();
cal1.setTime(deployment.getDeploymentTime());
cal1.set(Calendar.MILLISECOND, 0);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(result.getDeploymentTime());
cal2.set(Calendar.MILLISECOND, 0);
Assert.assertTrue(cal1.equals(cal2));
repositoryService.deleteDeployment(deployment.getId(), true);