@Test public void shouldRefreshUsableSpaceOfAgent() throws Exception { AgentIdentifier identifier = new AgentIdentifier("local.in", "127.0.0.1", "uuid-1"); String workingDirectory = FileUtils.getTempDirectory().getAbsolutePath(); AgentRuntimeInfo runtimeInfo = ElasticAgentRuntimeInfo.fromAgent(identifier, AgentRuntimeStatus.Idle, workingDirectory, false); long space = ElasticAgentRuntimeInfo.usableSpace(workingDirectory); assertThat(runtimeInfo.getUsableSpace(), is(space)); } }