Search in sources :

Example 21 with ServerConfig

use of com.thoughtworks.go.config.ServerConfig in project gocd by gocd.

the class CachedCommandSnippetsTest method setupAFakeCommandRepoLocation.

private void setupAFakeCommandRepoLocation(final String location, final String... otherLocations) {
    CruiseConfig cruiseConfig = mock(BasicCruiseConfig.class);
    ServerConfig serverConfig = mock(ServerConfig.class);
    when(systemEnvironment.get(COMMAND_REPOSITORY_DIRECTORY)).thenReturn("some-directory");
    when(goConfigService.currentCruiseConfig()).thenReturn(cruiseConfig);
    when(cruiseConfig.server()).thenReturn(serverConfig);
    when(serverConfig.getCommandRepositoryLocation()).thenReturn(location, otherLocations);
}
Also used : ServerConfig(com.thoughtworks.go.config.ServerConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig)

Aggregations

ServerConfig (com.thoughtworks.go.config.ServerConfig)21 BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)12 Test (org.junit.Test)12 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)11 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)7 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)6 AgentConfig (com.thoughtworks.go.config.AgentConfig)4 Username (com.thoughtworks.go.server.domain.Username)4 File (java.io.File)4 UpdateConfigCommand (com.thoughtworks.go.config.UpdateConfigCommand)3 ServerSiteUrlConfig (com.thoughtworks.go.domain.ServerSiteUrlConfig)3 HttpOperationResult (com.thoughtworks.go.server.service.result.HttpOperationResult)2 Before (org.junit.Before)2 Stage (com.thoughtworks.go.domain.Stage)1 SendEmailMessage (com.thoughtworks.go.server.messaging.SendEmailMessage)1 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1