diff --git a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/Machine.java b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/Machine.java index 5f85a66b4a..c0e884d3ac 100644 --- a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/Machine.java +++ b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/Machine.java @@ -37,4 +37,6 @@ public interface Machine { * */ Map getServers(); + + MachineStatus getStatus(); } diff --git a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/MachineStatus.java b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/MachineStatus.java index a67f30d1b3..6d4174a14c 100644 --- a/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/MachineStatus.java +++ b/core/che-core-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/runtime/MachineStatus.java @@ -26,5 +26,5 @@ public enum MachineStatus { STOPPED, /** Machine failed */ - FAILED; + FAILED } diff --git a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/MachineImpl.java b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/MachineImpl.java index 8bd0bc0375..2f98f38e5d 100644 --- a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/MachineImpl.java +++ b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/MachineImpl.java @@ -15,6 +15,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.api.core.model.workspace.runtime.Server; /** Data object for {@link Machine}. */ @@ -23,11 +24,16 @@ public class MachineImpl implements Machine { private String name; private Map attributes; private Map servers; + private MachineStatus status; public MachineImpl( - String name, Map attributes, Map servers) { + String name, + Map attributes, + Map servers, + MachineStatus status) { this.name = name; this.attributes = new HashMap<>(attributes); + this.status = status; if (servers != null) { this.servers = servers @@ -42,7 +48,7 @@ public class MachineImpl implements Machine { } public MachineImpl(String name, Machine machine) { - this(name, machine.getAttributes(), machine.getServers()); + this(name, machine.getAttributes(), machine.getServers(), machine.getStatus()); } public String getName() { @@ -65,26 +71,47 @@ public class MachineImpl implements Machine { return servers; } + @Override + public MachineStatus getStatus() { + return status; + } + public Optional getServerByName(String name) { return Optional.ofNullable(getServers().get(name)); } @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof MachineImpl)) return false; - MachineImpl that = (MachineImpl) o; - return Objects.equals(getAttributes(), that.getAttributes()) - && Objects.equals(getServers(), that.getServers()); + if (this == o) { + return true; + } + if (!(o instanceof MachineImpl)) { + return false; + } + MachineImpl machine = (MachineImpl) o; + return Objects.equals(getName(), machine.getName()) + && Objects.equals(getAttributes(), machine.getAttributes()) + && Objects.equals(getServers(), machine.getServers()) + && getStatus() == machine.getStatus(); } @Override public int hashCode() { - return Objects.hash(getAttributes(), getServers()); + return Objects.hash(getName(), getAttributes(), getServers(), getStatus()); } @Override public String toString() { - return "MachineImpl{" + "attributes=" + attributes + ", servers=" + servers + '}'; + return "MachineImpl{" + + "name='" + + name + + '\'' + + ", attributes=" + + attributes + + ", servers=" + + servers + + ", status=" + + status + + '}'; } } diff --git a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/RuntimeImpl.java b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/RuntimeImpl.java index 56676e28e5..165d69062b 100644 --- a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/RuntimeImpl.java +++ b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/workspace/model/RuntimeImpl.java @@ -47,11 +47,7 @@ public class RuntimeImpl implements Runtime { .collect( toMap( Map.Entry::getKey, - entry -> - new MachineImpl( - entry.getKey(), - entry.getValue().getAttributes(), - entry.getValue().getServers()))); + entry -> new MachineImpl(entry.getKey(), entry.getValue()))); } this.owner = owner; this.machineToken = machineToken; diff --git a/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerInternalRuntime.java b/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerInternalRuntime.java index 14f606ba1e..827a0b55df 100644 --- a/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerInternalRuntime.java +++ b/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerInternalRuntime.java @@ -277,6 +277,8 @@ public class DockerInternalRuntime extends InternalRuntime serverCheckerFactory.create(getContext().getIdentity(), name, machine.getServers()); readinessChecker.startAsync(new ServerReadinessHandler(name)); readinessChecker.await(); + + machine.setStatus(MachineStatus.RUNNING); } private void checkInterruption() throws InterruptedException { diff --git a/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerMachine.java b/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerMachine.java index 2d5dd2b1ce..26a05bc11a 100644 --- a/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerMachine.java +++ b/infrastructures/docker/infrastructure/src/main/java/org/eclipse/che/workspace/infrastructure/docker/DockerMachine.java @@ -17,6 +17,7 @@ import java.io.InputStream; import java.util.Collections; import java.util.Map; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.api.core.model.workspace.runtime.ServerStatus; import org.eclipse.che.api.workspace.server.model.impl.ServerImpl; import org.eclipse.che.api.workspace.server.spi.InfrastructureException; @@ -54,6 +55,8 @@ public class DockerMachine implements Machine { private final String registry; private final Map servers; + private MachineStatus status; + public DockerMachine( String containerId, String image, @@ -67,6 +70,7 @@ public class DockerMachine implements Machine { this.registry = registry; this.dockerMachineStopDetector = dockerMachineStopDetector; this.servers = servers; + this.status = MachineStatus.STARTING; } @Override @@ -79,6 +83,15 @@ public class DockerMachine implements Machine { return servers; } + @Override + public MachineStatus getStatus() { + return status; + } + + public void setStatus(MachineStatus status) { + this.status = status; + } + void setServerStatus(String serverRef, ServerStatus status) { if (servers == null) { throw new IllegalStateException("Servers are not initialized yet"); diff --git a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntime.java b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntime.java index cb1fbc1651..954bfbc3ba 100644 --- a/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntime.java +++ b/infrastructures/openshift/src/main/java/org/eclipse/che/workspace/infrastructure/openshift/OpenShiftInternalRuntime.java @@ -126,6 +126,7 @@ public class OpenShiftInternalRuntime extends InternalRuntime ref2Server; private final OpenShiftProject project; + private MachineStatus status; + public OpenShiftMachine( String machineName, String podName, @@ -47,6 +50,7 @@ public class OpenShiftMachine implements Machine { this.ref2Server.putAll(ref2Server); } this.project = project; + this.status = MachineStatus.STARTING; } public String getName() { @@ -71,7 +75,16 @@ public class OpenShiftMachine implements Machine { return ref2Server; } - void setStatus(String serverRef, ServerStatus status) { + @Override + public MachineStatus getStatus() { + return status; + } + + public void setStatus(MachineStatus status) { + this.status = status; + } + + void setServerStatus(String serverRef, ServerStatus status) { ServerImpl server = ref2Server.get(serverRef); if (server == null) { throw new IllegalArgumentException( diff --git a/plugins/plugin-gdb/che-plugin-gdb-ide/src/main/java/org/eclipse/che/plugin/gdb/ide/configuration/GdbConfigurationPagePresenter.java b/plugins/plugin-gdb/che-plugin-gdb-ide/src/main/java/org/eclipse/che/plugin/gdb/ide/configuration/GdbConfigurationPagePresenter.java index d8ee249ced..cdc83b56b5 100644 --- a/plugins/plugin-gdb/che-plugin-gdb-ide/src/main/java/org/eclipse/che/plugin/gdb/ide/configuration/GdbConfigurationPagePresenter.java +++ b/plugins/plugin-gdb/che-plugin-gdb-ide/src/main/java/org/eclipse/che/plugin/gdb/ide/configuration/GdbConfigurationPagePresenter.java @@ -109,6 +109,7 @@ public class GdbConfigurationPagePresenter private void setHosts(List machines) { Map hosts = new HashMap<>(); for (MachineImpl machine : machines) { + // TODO this attribute is not provided anymore String host = machine.getAttributes().get("network.ipAddress"); if (host == null) { continue; diff --git a/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java index f3449744d9..b55a45ea31 100644 --- a/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java +++ b/wsmaster/che-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/dto/MachineDto.java @@ -12,6 +12,7 @@ package org.eclipse.che.api.workspace.shared.dto; import java.util.Map; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.dto.shared.DTO; /** @author Alexander Garagatyi */ @@ -27,4 +28,9 @@ public interface MachineDto extends Machine { Map getServers(); MachineDto withServers(Map servers); + + @Override + MachineStatus getStatus(); + + MachineDto withStatus(MachineStatus status); } diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java index 3eaf84d2ef..7a71cf33f5 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/DtoConverter.java @@ -279,7 +279,10 @@ public final class DtoConverter { /** Converts {@link Machine} to {@link MachineDto}. */ public static MachineDto asDto(Machine machine) { - MachineDto machineDto = newDto(MachineDto.class).withAttributes(machine.getAttributes()); + MachineDto machineDto = + newDto(MachineDto.class) + .withAttributes(machine.getAttributes()) + .withStatus(machine.getStatus()); if (machine.getServers() != null) { machineDto.withServers( machine diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java index 2da7161b96..355d6fad25 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/MachineImpl.java @@ -14,6 +14,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.api.core.model.workspace.runtime.Server; /** @@ -25,14 +26,17 @@ public class MachineImpl implements Machine { private Map attributes; private Map servers; + private MachineStatus status; public MachineImpl(Machine machineRuntime) { - this(machineRuntime.getAttributes(), machineRuntime.getServers()); + this(machineRuntime.getAttributes(), machineRuntime.getServers(), machineRuntime.getStatus()); } - public MachineImpl(Map attributes, Map servers) { + public MachineImpl( + Map attributes, Map servers, MachineStatus status) { this(servers); this.attributes = new HashMap<>(attributes); + this.status = status; } public MachineImpl(Map servers) { @@ -64,22 +68,39 @@ public class MachineImpl implements Machine { return servers; } + @Override + public MachineStatus getStatus() { + return status; + } + @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof MachineImpl)) return false; + if (this == o) { + return true; + } + if (!(o instanceof MachineImpl)) { + return false; + } MachineImpl machine = (MachineImpl) o; return Objects.equals(getAttributes(), machine.getAttributes()) - && Objects.equals(getServers(), machine.getServers()); + && Objects.equals(getServers(), machine.getServers()) + && getStatus() == machine.getStatus(); } @Override public int hashCode() { - return Objects.hash(getAttributes(), getServers()); + return Objects.hash(getAttributes(), getServers(), getStatus()); } @Override public String toString() { - return "MachineImpl{" + "attributes=" + attributes + ", servers=" + servers + '}'; + return "MachineImpl{" + + "attributes=" + + attributes + + ", servers=" + + servers + + ", status=" + + status + + '}'; } } diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java index a003545924..ab2847dad9 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/spi/InternalRuntime.java @@ -79,7 +79,8 @@ public abstract class InternalRuntime implements Runti e -> new MachineImpl( e.getValue().getAttributes(), - rewriteExternalServers(e.getValue().getServers())))); + rewriteExternalServers(e.getValue().getServers()), + e.getValue().getStatus()))); } /** diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java index 91098b6d8f..f593b6701f 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceManagerTest.java @@ -52,6 +52,7 @@ import org.eclipse.che.api.core.model.workspace.Workspace; import org.eclipse.che.api.core.model.workspace.WorkspaceConfig; import org.eclipse.che.api.core.model.workspace.WorkspaceStatus; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.notification.EventService; import org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl; @@ -571,7 +572,7 @@ public class WorkspaceManagerTest { } private MachineImpl createMachine() { - return new MachineImpl(emptyMap(), emptyMap()); + return new MachineImpl(emptyMap(), emptyMap(), MachineStatus.RUNNING); } private RuntimeContext mockContext(RuntimeIdentity identity) throws Exception { diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceServiceTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceServiceTest.java index 5f69bbd9bd..21cf447f33 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceServiceTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/WorkspaceServiceTest.java @@ -19,6 +19,7 @@ import static java.util.Collections.singletonMap; import static java.util.stream.Collectors.toList; import static org.eclipse.che.api.core.model.workspace.WorkspaceStatus.STARTING; import static org.eclipse.che.api.core.model.workspace.config.MachineConfig.MEMORY_LIMIT_ATTRIBUTE; +import static org.eclipse.che.api.core.model.workspace.runtime.MachineStatus.RUNNING; import static org.eclipse.che.dto.server.DtoFactory.newDto; import static org.everrest.assured.JettyHttpServer.ADMIN_USER_NAME; import static org.everrest.assured.JettyHttpServer.ADMIN_USER_PASSWORD; @@ -329,7 +330,7 @@ public class WorkspaceServiceTest { Map servers = ImmutableMap.of("server1", createInternalServer(), externalServerKey, externalServer); Map machines = - singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers)); + singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers, RUNNING)); workspace.setRuntime(new RuntimeImpl("activeEnv", machines, "user123")); when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace); Map expected = @@ -337,6 +338,7 @@ public class WorkspaceServiceTest { "machine1", newDto(MachineDto.class) .withAttributes(singletonMap("key", "value")) + .withStatus(RUNNING) .withServers( singletonMap( externalServerKey, @@ -372,7 +374,7 @@ public class WorkspaceServiceTest { Map servers = ImmutableMap.of("server1", createInternalServer(), externalServerKey, externalServer); Map machines = - singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers)); + singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers, RUNNING)); workspace.setRuntime(new RuntimeImpl("activeEnv", machines, "user123")); when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace); Map expected = @@ -380,6 +382,7 @@ public class WorkspaceServiceTest { "machine1", newDto(MachineDto.class) .withAttributes(singletonMap("key", "value")) + .withStatus(RUNNING) .withServers( singletonMap( externalServerKey, @@ -415,7 +418,7 @@ public class WorkspaceServiceTest { ImmutableMap.of( internalServerKey, createInternalServer(), externalServerKey, externalServer); Map machines = - singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers)); + singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers, RUNNING)); workspace.setRuntime(new RuntimeImpl("activeEnv", machines, "user123")); when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace); @@ -424,6 +427,7 @@ public class WorkspaceServiceTest { "machine1", newDto(MachineDto.class) .withAttributes(singletonMap("key", "value")) + .withStatus(RUNNING) .withServers( ImmutableMap.of( externalServerKey, @@ -466,7 +470,7 @@ public class WorkspaceServiceTest { ImmutableMap.of( internalServerKey, createInternalServer(), externalServerKey, externalServer); Map machines = - singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers)); + singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers, RUNNING)); workspace.setRuntime(new RuntimeImpl("activeEnv", machines, "user123")); when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace); @@ -475,6 +479,7 @@ public class WorkspaceServiceTest { "machine1", newDto(MachineDto.class) .withAttributes(singletonMap("key", "value")) + .withStatus(RUNNING) .withServers( ImmutableMap.of( externalServerKey, @@ -517,7 +522,7 @@ public class WorkspaceServiceTest { ImmutableMap.of( internalServerKey, createInternalServer(), externalServerKey, externalServer); Map machines = - singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers)); + singletonMap("machine1", new MachineImpl(singletonMap("key", "value"), servers, RUNNING)); workspace.setRuntime(new RuntimeImpl("activeEnv", machines, "user123")); when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace); @@ -526,6 +531,7 @@ public class WorkspaceServiceTest { "machine1", newDto(MachineDto.class) .withAttributes(singletonMap("key", "value")) + .withStatus(RUNNING) .withServers( ImmutableMap.of( externalServerKey, diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/InternalRuntimeTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/InternalRuntimeTest.java index 059a3c92ff..bacc7805b8 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/InternalRuntimeTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/spi/InternalRuntimeTest.java @@ -41,6 +41,7 @@ import org.eclipse.che.api.core.ValidationException; import org.eclipse.che.api.core.model.workspace.Warning; import org.eclipse.che.api.core.model.workspace.config.ServerConfig; import org.eclipse.che.api.core.model.workspace.runtime.Machine; +import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus; import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity; import org.eclipse.che.api.core.model.workspace.runtime.ServerStatus; import org.eclipse.che.api.workspace.server.URLRewriter; @@ -325,7 +326,8 @@ public class InternalRuntimeTest { MachineImpl machineWithInternalServer = new MachineImpl( createAttributes(), - ImmutableMap.of("server1", regularServer, "server2", internalServer)); + ImmutableMap.of("server1", regularServer, "server2", internalServer), + MachineStatus.RUNNING); ImmutableMap internalMachines = ImmutableMap.of("m1", createMachine(), "m2", machineWithInternalServer); ImmutableMap expected = @@ -335,7 +337,8 @@ public class InternalRuntimeTest { "m2", new MachineImpl( createAttributes(), - ImmutableMap.of("server1", rewriteURL(regularServer), "server2", internalServer))); + ImmutableMap.of("server1", rewriteURL(regularServer), "server2", internalServer), + MachineStatus.RUNNING)); setRunningRuntime(); doReturn(internalMachines).when(internalRuntime).getInternalMachines(); @@ -410,7 +413,8 @@ public class InternalRuntimeTest { expectedProps, singletonMap( expectedServerName, - new ServerImpl().withUrl(expectedServerUrl).withStatus(expectedServerStatus))); + new ServerImpl().withUrl(expectedServerUrl).withStatus(expectedServerStatus)), + MachineStatus.RUNNING); HashMap result = new HashMap<>(); result.put("m1", createMachine()); result.put("m2", createMachine()); @@ -476,7 +480,8 @@ public class InternalRuntimeTest { machine1.getServers().put(badServerName, failingRewritingServer); internalMachines.put("m1", machine1); internalMachines.put("m2", machine2); - expectedMachines.put("m1", new MachineImpl(machine1.getAttributes(), expectedServers)); + expectedMachines.put( + "m1", new MachineImpl(machine1.getAttributes(), expectedServers, machine1.getStatus())); expectedMachines.put("m2", machine2); List expectedWarnings = new ArrayList<>(); expectedWarnings.add( @@ -497,7 +502,7 @@ public class InternalRuntimeTest { } private static MachineImpl createMachine() throws Exception { - return new MachineImpl(createAttributes(), createServers()); + return new MachineImpl(createAttributes(), createServers(), MachineStatus.RUNNING); } private static Map createAttributes() {