Search in sources :

Example 1 with NullAgentInstance

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")));
}
Also used : AgentConfig(com.thoughtworks.go.config.AgentConfig) Agents(com.thoughtworks.go.config.Agents) NullAgentInstance(com.thoughtworks.go.domain.NullAgentInstance) Test(org.junit.Test)

Aggregations

AgentConfig (com.thoughtworks.go.config.AgentConfig)1 Agents (com.thoughtworks.go.config.Agents)1 NullAgentInstance (com.thoughtworks.go.domain.NullAgentInstance)1 Test (org.junit.Test)1