use of jetbrains.buildServer.agent.BuildParametersMap in project teamcity-git by JetBrains.
the class AgentStartupGitDetectorTest method should_set_path_to_detected_git_if_not_set_by_user.
private void should_set_path_to_detected_git_if_not_set_by_user() {
final BuildAgent agent = myContext.mock(BuildAgent.class);
myContext.checking(new Expectations() {
{
BuildAgentConfiguration config = myContext.mock(BuildAgentConfiguration.class);
BuildParametersMap paramsMap = myContext.mock(BuildParametersMap.class);
Map<String, String> params = new HashMap<String, String>();
atLeast(1).of(agent).getConfiguration();
will(returnValue(config));
atLeast(1).of(config).getBuildParameters();
will(returnValue(paramsMap));
atLeast(1).of(paramsMap).getEnvironmentVariables();
will(returnValue(params));
atLeast(1).of(config).addEnvironmentVariable(with(Constants.TEAMCITY_AGENT_GIT_PATH), with(any(String.class)));
}
});
myDetector.afterAgentConfigurationLoaded(agent);
myContext.assertIsSatisfied();
}
use of jetbrains.buildServer.agent.BuildParametersMap in project teamcity-git by JetBrains.
the class AgentStartupGitDetectorTest method should_do_nothing_if_path_to_git_set_by_user.
public void should_do_nothing_if_path_to_git_set_by_user() {
final BuildAgent agent = myContext.mock(BuildAgent.class);
myContext.checking(new Expectations() {
{
BuildAgentConfiguration config = myContext.mock(BuildAgentConfiguration.class);
BuildParametersMap paramsMap = myContext.mock(BuildParametersMap.class);
Map<String, String> params = new HashMap<String, String>() {
{
put(Constants.TEAMCITY_AGENT_GIT_PATH, "/some/path/to/git");
}
};
atLeast(1).of(agent).getConfiguration();
will(returnValue(config));
atLeast(1).of(config).getBuildParameters();
will(returnValue(paramsMap));
atLeast(1).of(paramsMap).getEnvironmentVariables();
will(returnValue(params));
}
});
myDetector.afterAgentConfigurationLoaded(agent);
myContext.assertIsSatisfied();
}
Aggregations