/*
* Requestor: A
* No committers.
* Tests {a,b} fail.
*/
final FreeStyleBuild build1 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build1.getResult()).thenReturn(Result.UNSTABLE);
addMockRequestor(build1, "A");
addMockTestResultAction(build1, build1, build1);
checkRecipients(build1, "A");
/*
* Requestor: (none)
* Committers {U,V}.
* Tests {a,b,c} fail.
*/
final FreeStyleBuild build2 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build2.getPreviousCompletedBuild()).thenReturn(build1);
PowerMockito.when(build2.getResult()).thenReturn(Result.UNSTABLE);
addMockChangeSet(build2, "U", "V");
addMockTestResultAction(build2, build1, build1, build2);
checkRecipients(build2, "A", "U", "V");
/**
* Requestor: (none)
* Committers {X,V}.
* Tests {c,d} fail.
*/
final FreeStyleBuild build3 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build3.getPreviousCompletedBuild()).thenReturn(build2);
PowerMockito.when(build3.getResult()).thenReturn(Result.UNSTABLE);
addMockChangeSet(build3, "X", "V");
addMockTestResultAction(build3, build2, build3);
checkRecipients(build3, "U", "V", "X");
/**
* Requestor: (none)
* Committers {K}
* No tests were performed. The build failed.
*/
final FreeStyleBuild build4 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build4.getPreviousCompletedBuild()).thenReturn(build3);
PowerMockito.when(build4.getResult()).thenReturn(Result.FAILURE);
addMockChangeSet(build4, "K");
checkRecipients(build4);
/**
* Requestor: (none)
* Committers {X,U,V}.
* No tests were performed. The build failed.
*/
final FreeStyleBuild build5 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build5.getPreviousCompletedBuild()).thenReturn(build4);
PowerMockito.when(build5.getResult()).thenReturn(Result.FAILURE);
addMockChangeSet(build5, "U", "W");
checkRecipients(build5);
/**
* Requestor: A
* Committers {W}.
* Tests {a,e (new test)} fail.
*/
final FreeStyleBuild build6 = PowerMockito.mock(FreeStyleBuild.class);
PowerMockito.when(build6.getPreviousCompletedBuild()).thenReturn(build5);
PowerMockito.when(build6.getResult()).thenReturn(Result.UNSTABLE);
addMockRequestor(build6, "A");
addMockChangeSet(build6, "W");
addMockTestResultAction(build6, build6, build6);
checkRecipients(build6, "A", "K", "U", "W");
}