use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentTest method cookieAssignedShouldReturnTrueWhenAgentHasCookie.
@Test
void cookieAssignedShouldReturnTrueWhenAgentHasCookie() {
Agent agent = new Agent("uuid", "host", "127.0.0.1", "cookie");
assertThat(agent.cookieAssigned(), is(true));
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentTest method cookieAssignedShouldReturnFalseWhenAgentDoesNotHaveCookie.
@Test
void cookieAssignedShouldReturnFalseWhenAgentDoesNotHaveCookie() {
Agent agent = new Agent("uuid", "host", "127.0.0.1");
assertThat(agent.cookieAssigned(), is(false));
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class JobStatusJsonPresentationModelTest method shouldShowBuildStatus.
@Test
public void shouldShowBuildStatus() {
JobInstance instance = assigned("test");
instance.setId(12);
instance.setAgentUuid("1234");
final Agent agent = new Agent("1234", "localhost", "1234", "cookie");
JobStatusJsonPresentationModel presenter = new JobStatusJsonPresentationModel(instance, agent, mock(DurationBean.class));
Map json = presenter.toJsonHash();
assertThatJson(new Gson().toJson(json)).when(IGNORING_EXTRA_FIELDS).isEqualTo("{\n" + " \"name\": \"test\",\n" + " \"id\": \"12\",\n" + " \"agent\": \"localhost\",\n" + " \"current_status\": \"assigned\"\n" + "}");
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class ElasticAgentRuntimeInfo method agent.
@Override
public Agent agent() {
Agent agent = super.agent();
agent.setElasticAgentId(elasticAgentId);
agent.setElasticPluginId(elasticPluginId);
return agent;
}
use of com.thoughtworks.go.config.Agent in project gocd by gocd.
the class AgentRuntimeInfoTest method shouldUsingIdleWhenRegistrationRequestIsFromLocalAgent.
@Test
public void shouldUsingIdleWhenRegistrationRequestIsFromLocalAgent() {
AgentRuntimeInfo agentRuntimeInfo = AgentRuntimeInfo.fromServer(new Agent("uuid", "localhost", "127.0.0.1"), false, "/var/lib", 0L, "linux");
assertThat(agentRuntimeInfo.getRuntimeStatus(), is(Idle));
}
Aggregations