use of com.thoughtworks.go.config.ResourceConfigs in project gocd by gocd.
the class AgentInstanceTest method shouldNotMatchJobPlanIfTheAgentIsElasticAndJobHasResourcesDefined.
@Test
public void shouldNotMatchJobPlanIfTheAgentIsElasticAndJobHasResourcesDefined() {
AgentConfig agentConfig = new AgentConfig("uuid", "hostname", "11.1.1.1", new ResourceConfigs(new ResourceConfig("r1")));
agentConfig.setElasticAgentId("elastic-agent-id-1");
String elasticPluginId = "elastic-plugin-id-1";
agentConfig.setElasticPluginId(elasticPluginId);
AgentInstance agentInstance = new AgentInstance(agentConfig, REMOTE, mock(SystemEnvironment.class), null);
DefaultJobPlan jobPlan1 = new DefaultJobPlan();
jobPlan1.setResources(asList(new Resource("r1")));
List<JobPlan> jobPlans = asList(jobPlan1, new DefaultJobPlan());
assertThat(agentInstance.firstMatching(jobPlans), is(nullValue()));
}
use of com.thoughtworks.go.config.ResourceConfigs in project gocd by gocd.
the class ResourcesTest method shouldConvertResourceConfigsToListOfResource.
@Test
public void shouldConvertResourceConfigsToListOfResource() {
final Resources resources = new Resources(new ResourceConfigs("foo,bar"));
assertThat(resources, hasSize(2));
assertThat(resources, contains(new Resource("foo"), new Resource("bar")));
}
Aggregations