test_class.declarator: servers = new String[]{ "192.168.0.1", "192.168.0.2" }
test_class.modifier: private final
test_class.original_string: private final String[] servers = new String[]{ "192.168.0.1", "192.168.0.2" };
test_class.type: String[]
test_class.var_name: servers
test_class.declarator: clusterManager = mock(ClusterDiskSpaceManager.class)
test_class.modifier: private final
test_class.original_string: private final ClusterDiskSpaceManager clusterManager = mock(ClusterDiskSpaceManager.class);
test_class.type: ClusterDiskSpaceManager
test_class.var_name: clusterManager
test_class.declarator: spaceMap = new HashMap<>()
test_class.modifier: private final
test_class.original_string: private final Map<String, DiskSpace> spaceMap = new HashMap<>();
test_class.type: Map<String, DiskSpace>
test_class.var_name: spaceMap
test_class.declarator: threshold = mock(DiskSpaceThreshold.class)
test_class.modifier: private final
test_class.original_string: private final DiskSpaceThreshold threshold = mock(DiskSpaceThreshold.class);
test_class.type: DiskSpaceThreshold
test_class.var_name: threshold
test_class.declarator: checker
test_class.modifier: private
test_class.original_string: private ClusterDiskSpaceChecker checker;
test_class.type: ClusterDiskSpaceChecker
test_class.var_name: checker
test_class.file: harahachibu/src/test/java/uk/co/flax/harahachibu/services/impl/ClusterDiskSpaceCheckerTest.java
test_class.identifier: ClusterDiskSpaceCheckerTest
test_case.body: @Test
  	public void returnsTrueWhenServersPass() throws Exception {
  		final DiskSpace server0Space = new DiskSpace(128L, 1024L);
  		spaceMap.put(servers[0], server0Space);
  		final DiskSpace server1Space = new DiskSpace(128L, 512L);
  		spaceMap.put(servers[1], server1Space);
  
  		when(threshold.withinThreshold(server0Space)).thenReturn(true);
  		when(threshold.withinThreshold(server1Space)).thenReturn(true);
  
  		boolean isSpace = checker.isSpaceAvailable();
  
  		assertThat(isSpace).isTrue();
  		verify(threshold).withinThreshold(server0Space);
  		verify(threshold).withinThreshold(server1Space);
  		verify(clusterManager).getServers();
  		verify(clusterManager).getDiskSpace();
  	}
test_case.class_method_signature: ClusterDiskSpaceCheckerTest.returnsTrueWhenServersPass()
test_case.full_signature: @Test public void returnsTrueWhenServersPass()
test_case.identifier: returnsTrueWhenServersPass
test_case.invocations: put put thenReturn when withinThreshold thenReturn when withinThreshold isSpaceAvailable isTrue assertThat withinThreshold verify withinThreshold verify getServers verify getDiskSpace verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void returnsTrueWhenServersPass()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(ClusterDiskSpaceChecker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(ClusterDiskSpaceChecker.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: CLUSTER_SERVERS_CONFIG_OPTION = "clusterServers"
focal_class.modifier: public static final
focal_class.original_string: public static final String CLUSTER_SERVERS_CONFIG_OPTION = "clusterServers";
focal_class.type: String
focal_class.var_name: CLUSTER_SERVERS_CONFIG_OPTION
focal_class.declarator: clusterManager
focal_class.modifier: private final
focal_class.original_string: private final ClusterDiskSpaceManager clusterManager;
focal_class.type: ClusterDiskSpaceManager
focal_class.var_name: clusterManager
focal_class.declarator: threshold
focal_class.modifier: private
focal_class.original_string: private DiskSpaceThreshold threshold;
focal_class.type: DiskSpaceThreshold
focal_class.var_name: threshold
focal_class.file: harahachibu/src/main/java/uk/co/flax/harahachibu/services/impl/ClusterDiskSpaceChecker.java
focal_class.identifier: ClusterDiskSpaceChecker
focal_class.interfaces: implements DiskSpaceChecker
focal_class.class_method_signature: ClusterDiskSpaceChecker.ClusterDiskSpaceChecker(ClusterDiskSpaceManager clusterManager)
focal_class.full_signature: public  ClusterDiskSpaceChecker(ClusterDiskSpaceManager clusterManager)
focal_class.identifier: ClusterDiskSpaceChecker
focal_class.modifiers: public
focal_class.parameters: (ClusterDiskSpaceManager clusterManager)
focal_class.signature:  ClusterDiskSpaceChecker(ClusterDiskSpaceManager clusterManager)
focal_class.class_method_signature: ClusterDiskSpaceChecker.isSpaceAvailable()
focal_class.full_signature: @Override public boolean isSpaceAvailable()
focal_class.identifier: isSpaceAvailable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSpaceAvailable()
focal_class.class_method_signature: ClusterDiskSpaceChecker.configure(Map<String, Object> configuration)
focal_class.full_signature: @Override public void configure(Map<String, Object> configuration)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, Object> configuration)
focal_class.return: void
focal_class.signature: void configure(Map<String, Object> configuration)
focal_class.class_method_signature: ClusterDiskSpaceChecker.requiresHttpClient()
focal_class.full_signature: @Override public boolean requiresHttpClient()
focal_class.identifier: requiresHttpClient
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean requiresHttpClient()
focal_class.class_method_signature: ClusterDiskSpaceChecker.setHttpClient(Client httpClient)
focal_class.full_signature: @Override public void setHttpClient(Client httpClient)
focal_class.identifier: setHttpClient
focal_class.modifiers: @Override public
focal_class.parameters: (Client httpClient)
focal_class.return: void
focal_class.signature: void setHttpClient(Client httpClient)
focal_class.class_method_signature: ClusterDiskSpaceChecker.setThreshold(DiskSpaceThreshold threshold)
focal_class.full_signature: @Override public void setThreshold(DiskSpaceThreshold threshold)
focal_class.identifier: setThreshold
focal_class.modifiers: @Override public
focal_class.parameters: (DiskSpaceThreshold threshold)
focal_class.return: void
focal_class.signature: void setThreshold(DiskSpaceThreshold threshold)
focal_method.body: @Override
  	public boolean isSpaceAvailable() throws DiskSpaceCheckerException {
  		Map<String, DiskSpace> clusterSpace = clusterManager.getDiskSpace();
  		boolean withinThreshold = true;
  
  		for (String server : clusterManager.getServers()) {
  			DiskSpace ds = clusterSpace.get(server);
  			if (ds == null) {
  				LOGGER.warn("No DiskSpace details for {} - returning false", server);
  				withinThreshold = false;
  				break;
  			} else if (!threshold.withinThreshold(ds)) {
  				LOGGER.debug("Server {} does not have enough space", server);
  				withinThreshold = false;
  			}
  		}
  
  		LOGGER.debug("Cluster threshold check returning {}", withinThreshold);
  
  		return withinThreshold;
  	}
focal_method.class_method_signature: ClusterDiskSpaceChecker.isSpaceAvailable()
focal_method.full_signature: @Override public boolean isSpaceAvailable()
focal_method.identifier: isSpaceAvailable
focal_method.invocations: getDiskSpace getServers get warn withinThreshold debug debug
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean isSpaceAvailable()