use of com.thoughtworks.go.util.ClassMockery in project gocd by gocd.
the class EmailNotificationListenerTest method setUp.
@Before
public void setUp() throws Exception {
context = new ClassMockery();
goConfigService = context.mock(GoConfigService.class);
goMailSenderFactory = context.mock(EmailNotificationListener.GoMailSenderFactory.class);
emailNotificationListener = new EmailNotificationListener(goConfigService, goMailSenderFactory);
}
use of com.thoughtworks.go.util.ClassMockery in project gocd by gocd.
the class StageCctrayPresentationModelTest method stageFailingShouldBeTreatedAsCompleted.
@Test
public void stageFailingShouldBeTreatedAsCompleted() throws Exception {
ClassMockery context = new ClassMockery();
final Stage stage = context.mock(Stage.class);
context.checking(new Expectations() {
{
allowing(stage).stageState();
will(returnValue(StageState.Failing));
}
});
StageCctrayPresentationModel presenter = new StageCctrayPresentationModel(null, stage);
assertThat(presenter.stageActivity(), is("Sleeping"));
}
use of com.thoughtworks.go.util.ClassMockery in project gocd by gocd.
the class WorkAssignmentsTest method setup.
@Before
public void setup() {
context = new ClassMockery();
idleAgentsTopic = context.mock(IdleAgentTopic.class, "idle_topic");
assignedWorkTopic = context.mock(WorkAssignedTopic.class, "assigned_work_topic");
context.checking(new Expectations() {
{
one(assignedWorkTopic).addListener(with(any(WorkAssignments.class)));
}
});
assignments = new WorkAssignments(idleAgentsTopic, assignedWorkTopic);
agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", "uuid");
agent = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
}
use of com.thoughtworks.go.util.ClassMockery in project gocd by gocd.
the class P4OutputParserTest method setUp.
@Before
public void setUp() throws Exception {
context = new ClassMockery();
p4Client = context.mock(P4Client.class);
parser = new P4OutputParser(p4Client);
}
use of com.thoughtworks.go.util.ClassMockery in project gocd by gocd.
the class PipelineActiveCheckerTest method setUp.
@Before
public void setUp() throws Exception {
mockery = new ClassMockery();
service = mockery.mock(CurrentActivityService.class);
pipelineIdentifier = new PipelineIdentifier("cruise", 1, "label-1");
checker = new PipelineActiveChecker(service, pipelineIdentifier);
}
Aggregations