use of com.thoughtworks.go.domain.NullAgentInstance in project gocd by gocd.
the class AgentInstancesTest method shouldRemoveAgentWhenAgentIsRemovedFromConfigFile.
@Test
public void shouldRemoveAgentWhenAgentIsRemovedFromConfigFile() throws Exception {
AgentInstances agentInstances = new AgentInstances(null, systemEnvironment, idle, building);
Agents oneAgentIsRemoved = new Agents(new AgentConfig("uuid2", "CCeDev01", "10.18.5.1"));
agentInstances.sync(oneAgentIsRemoved);
assertThat(agentInstances.size(), is(1));
assertThat(agentInstances.findAgentAndRefreshStatus("uuid2"), is(idle));
assertThat(agentInstances.findAgentAndRefreshStatus("uuid1"), is(new NullAgentInstance("uuid1")));
}
Aggregations