use of com.thoughtworks.gocd.elasticagent.ecs.PluginRequest in project gocd-ecs-elastic-agent by gocd.
the class CreateAgentRequestExecutorTest method shouldAskECSTaskToCreateAnAgent.
@Test
void shouldAskECSTaskToCreateAnAgent() throws Exception {
ClusterProfileProperties settings = mock(ClusterProfileProperties.class);
CreateAgentRequest request = mock(CreateAgentRequest.class);
when(request.clusterProfileProperties()).thenReturn(settings);
when(request.getJobIdentifier()).thenReturn(new JobIdentifier("test-pipeline", 1L, "Test Pipeline", "test-stage", "1", "test-job", 100L));
when(request.elasticProfile()).thenReturn(new ElasticAgentProfileProperties());
ECSTasks agentInstances = mock(ECSTasks.class);
PluginRequest pluginRequest = mock(PluginRequest.class);
final EventStream eventStream = mock(EventStream.class);
new CreateAgentRequestExecutor(request, agentInstances, pluginRequest, eventStream).execute();
verify(agentInstances).create(eq(request), eq(settings), any(ConsoleLogAppender.class));
}
Aggregations