use of com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata in project gocd by gocd.
the class ElasticAgentPluginRegistryTest method shouldTalkToExtensionToExecuteShouldAssignWorkCall.
@Test
public void shouldTalkToExtensionToExecuteShouldAssignWorkCall() {
final String environment = "test-env";
final JobIdentifier jobIdentifier = new JobIdentifier();
final Map<String, String> configuration = Collections.singletonMap("GoServerURL", "foo");
final AgentMetadata agentMetadata = new AgentMetadata("som-id", "Idle", "Idle", "Enabled");
elasticAgentPluginRegistry.shouldAssignWork(pluginDescriptor, agentMetadata, environment, configuration, jobIdentifier);
verify(elasticAgentExtension, times(1)).shouldAssignWork(PLUGIN_ID, agentMetadata, environment, configuration, jobIdentifier);
verifyNoMoreInteractions(elasticAgentExtension);
}
use of com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata in project gocd by gocd.
the class AgentMetadataConverterV1Test method fromDTO_shouldConvertToAgentMetadataFromAgentMetadataDTO.
@Test
public void fromDTO_shouldConvertToAgentMetadataFromAgentMetadataDTO() {
final AgentMetadataDTO agentMetadataDTO = new AgentMetadataDTO("agent-id", "Idle", "Building", "Enabled");
final AgentMetadata agentMetadata = new AgentMetadataConverterV1().fromDTO(agentMetadataDTO);
assertThat(agentMetadata.elasticAgentId(), is("agent-id"));
assertThat(agentMetadata.agentState(), is("Idle"));
assertThat(agentMetadata.buildState(), is("Building"));
assertThat(agentMetadata.configState(), is("Enabled"));
}
use of com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata in project gocd by gocd.
the class AgentMetadataConverterV2Test method fromDTO_shouldConvertToAgentMetadataDTOFromAgentMetadata.
@Test
public void fromDTO_shouldConvertToAgentMetadataDTOFromAgentMetadata() {
final AgentMetadata agentMetadata = new AgentMetadata("agent-id", "Idle", "Building", "Enabled");
final AgentMetadataDTO agentMetadataDTO = new AgentMetadataConverterV2().toDTO(agentMetadata);
assertThat(agentMetadataDTO.elasticAgentId(), is("agent-id"));
assertThat(agentMetadataDTO.agentState(), is("Idle"));
assertThat(agentMetadataDTO.buildState(), is("Building"));
assertThat(agentMetadataDTO.configState(), is("Enabled"));
}
use of com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata in project gocd by gocd.
the class AgentMetadataConverterV2Test method fromDTO_shouldConvertToAgentMetadataFromAgentMetadataDTO.
@Test
public void fromDTO_shouldConvertToAgentMetadataFromAgentMetadataDTO() {
final AgentMetadataDTO agentMetadataDTO = new AgentMetadataDTO("agent-id", "Idle", "Building", "Enabled");
final AgentMetadata agentMetadata = new AgentMetadataConverterV2().fromDTO(agentMetadataDTO);
assertThat(agentMetadata.elasticAgentId(), is("agent-id"));
assertThat(agentMetadata.agentState(), is("Idle"));
assertThat(agentMetadata.buildState(), is("Building"));
assertThat(agentMetadata.configState(), is("Enabled"));
}
use of com.thoughtworks.go.plugin.access.elastic.models.AgentMetadata in project gocd by gocd.
the class AgentMetadataConverterV3Test method fromDTO_shouldConvertToAgentMetadataDTOFromAgentMetadata.
@Test
public void fromDTO_shouldConvertToAgentMetadataDTOFromAgentMetadata() {
final AgentMetadata agentMetadata = new AgentMetadata("agent-id", "Idle", "Building", "Enabled");
final AgentMetadataDTO agentMetadataDTO = new AgentMetadataConverterV3().toDTO(agentMetadata);
assertThat(agentMetadataDTO.elasticAgentId(), is("agent-id"));
assertThat(agentMetadataDTO.agentState(), is("Idle"));
assertThat(agentMetadataDTO.buildState(), is("Building"));
assertThat(agentMetadataDTO.configState(), is("Enabled"));
}
Aggregations