Search in sources :

Example 1 with AgentDao

use of com.thoughtworks.go.server.persistence.AgentDao in project gocd by gocd.

the class AgentServiceTest method setUp.

@Before
public void setUp() {
    agentInstances = mock(AgentInstances.class);
    AgentConfig config = new AgentConfig("uuid", "host", "192.168.1.1");
    when(agentInstances.findAgentAndRefreshStatus("uuid")).thenReturn(AgentInstance.createFromConfig(config, new SystemEnvironment()));
    agentDao = mock(AgentDao.class);
    uuidGenerator = mock(UuidGenerator.class);
    agentService = new AgentService(mock(AgentConfigService.class), new SystemEnvironment(), agentInstances, mock(EnvironmentConfigService.class), mock(GoConfigService.class), mock(SecurityService.class), agentDao, uuidGenerator, serverHealthService = mock(ServerHealthService.class));
    agentIdentifier = config.getAgentIdentifier();
    when(agentDao.cookieFor(agentIdentifier)).thenReturn("cookie");
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) AgentInstances(com.thoughtworks.go.server.domain.AgentInstances) AgentConfig(com.thoughtworks.go.config.AgentConfig) UuidGenerator(com.thoughtworks.go.server.util.UuidGenerator) AgentDao(com.thoughtworks.go.server.persistence.AgentDao) ServerHealthService(com.thoughtworks.go.serverhealth.ServerHealthService) Before(org.junit.Before)

Aggregations

AgentConfig (com.thoughtworks.go.config.AgentConfig)1 AgentInstances (com.thoughtworks.go.server.domain.AgentInstances)1 AgentDao (com.thoughtworks.go.server.persistence.AgentDao)1 UuidGenerator (com.thoughtworks.go.server.util.UuidGenerator)1 ServerHealthService (com.thoughtworks.go.serverhealth.ServerHealthService)1 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1 Before (org.junit.Before)1