AutonomicClusterManagementService { @Transactional(readOnly = false) public void markAdministrationStatusInClusterAsDone(long clusterId) { clusterDaoJdbc.setClusterLastAdministration(new Date(), clusterId); clusterDaoJdbc.setClusterAdministrationStatus(ClusterAdministrationStatus.Done, 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 markAdministrationStatusInClusterAsDoneTest() { Mockito.doNothing().when(clusterDaoJdbc).setClusterLastAdministration(Mockito.any(Date.class), Mockito.anyLong()); Mockito.doNothing().when(clusterDaoJdbc).setClusterAdministrationStatus(Mockito.any(ClusterAdministrationStatus.class), Mockito.anyLong()); autonomicClusterManagementService.markAdministrationStatusInClusterAsDone(0l); InOrder inOrder = Mockito.inOrder(clusterDaoJdbc); inOrder.verify(clusterDaoJdbc).setClusterLastAdministration(Mockito.any(Date.class), Mockito.anyLong()); inOrder.verify(clusterDaoJdbc).setClusterAdministrationStatus(Mockito.any(ClusterAdministrationStatus.class), Mockito.anyLong()); }