AutonomicClusterManagementHeuristicService { public ClusterAdministrationHeuristicAlgorithm getAdministrationAlgorithm() { String algorithmName = configurationDao.getValue(CLUSTER_ADMINISTRATION_ALGORITHMS_IN_CONFIGURATION_KEY); if (StringUtils.isBlank(algorithmName)) { return getDummyClusterManagementHeuristc(); } return getInstanceOfClass(algorithmName); }  ClusterAdministrationHeuristicAlgorithm getAdministrationAlgorithm(); final static String CLUSTER_ADMINISTRATION_ALGORITHMS_IN_CONFIGURATION_KEY; }
@Test public void getAdministrationAlgorithmTest() { Mockito.when(configurationDao.getValue(Mockito.eq(CLUSTER_ADMINISTRATION_ALGORITHMS_IN_CONFIGURATION_KEY))).thenReturn("algorithmName"); spy.getAdministrationAlgorithm(); verifyGetAdministrationAlgorithm(1); }
@Test public void getAdministrationAlgorithmTestAlgorithmNameIsBlank() { Mockito.when(configurationDao.getValue(Mockito.eq(CLUSTER_ADMINISTRATION_ALGORITHMS_IN_CONFIGURATION_KEY))).thenReturn(""); spy.getAdministrationAlgorithm(); verifyGetAdministrationAlgorithm(0); }