public static ElasticAgentRuntimeInfo fromAgent(AgentIdentifier identifier, AgentRuntimeStatus runtimeStatus,
                                                    String workingDir, String elasticAgentId, String pluginId,
                                                    String agentBootstrapperVersion, String agentVersion, Supplier<String> operatingSystemNameSupplier) {
        ElasticAgentRuntimeInfo runtimeInfo = new ElasticAgentRuntimeInfo(identifier, runtimeStatus, workingDir, null, elasticAgentId, pluginId);
        return (ElasticAgentRuntimeInfo) runtimeInfo
                .refreshOperatingSystem(operatingSystemNameSupplier)
                .refreshUsableSpace()
                .updateBootstrapperVersion(agentBootstrapperVersion)
                .updateAgentVersion(agentVersion);
    }
@Test
    public void shouldUpdateAgentAndBootstrapperVersions() {
        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, "20.3.0-1234", "20.5.0-2345", TEST_OS_SUPPLIER);

        assertThat(runtimeInfo.getAgentVersion(), is("20.5.0-2345"));
        assertThat(runtimeInfo.getAgentBootstrapperVersion(), is("20.3.0-1234"));
    }