AutonomicClusterManagementService { @Transactional(readOnly = false) public void setClusterWorkInProgress(long clusterId) { clusterDaoJdbc.setClusterAdministrationStatus(ClusterAdministrationStatus.InProgress, clusterId); logger.debug("Starting the process on cluster = " + clusterId); }  boolean isClusterBeingAdministrated(long id); boolean canProcessCluster(long clusterId, ClusterAdministrationHeuristicAlgorithm algorithm); @Transactional(readOnly = false) void setClusterWorkInProgress(long clusterId); @Transactional(readOnly = false) void markAdministrationStatusInClusterAsDone(long clusterId); @Transactional(readOnly = false) @Scheduled(initialDelay = ONE_MINUTE_IN_MILLISECONDS, fixedDelay = ONE_MINUTE_IN_MILLISECONDS * NUMBER_OF_MINUTES_BETWEEN_CHECKS) void removeClusterStuckProcessing();  }
@Test public void setClusterWorkInProgressTest() { Mockito.doNothing().when(clusterDaoJdbc).setClusterAdministrationStatus(Mockito.any(ClusterAdministrationStatus.class), Mockito.anyLong()); autonomicClusterManagementService.setClusterWorkInProgress(0l); Mockito.verify(clusterDaoJdbc).setClusterAdministrationStatus(Mockito.any(ClusterAdministrationStatus.class), Mockito.anyLong()); }