Skip to content

Commit

Permalink
Merge pull request #51 from raul-arabaolaza/JENKINS-44467
Browse files Browse the repository at this point in the history
[JENKINS-44467] Matrix project CombinationFilterUsingBuildParamsTest is failling on the PCT
  • Loading branch information
olivergondza committed May 24, 2017
2 parents f96421a + 1f56acc commit 7a675c3
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -23,6 +23,7 @@
*/
package hudson.matrix;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand Down Expand Up @@ -72,7 +73,7 @@
* @author ogondza
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({Jenkins.class, MatrixBuildListener.class, MatrixProject.class, AbstractItem.class, Whitelist.class})
@PrepareForTest({MatrixBuildListener.class, MatrixProject.class, AbstractItem.class, Whitelist.class})
public class CombinationFilterUsingBuildParamsTest {

/**
Expand Down Expand Up @@ -110,7 +111,6 @@ true, touchstoneFilter, Result.SUCCESS, new NoopMatrixConfigurationSorter()
@Mock private MatrixRun run;
@Mock private BuildListener listener;

@Mock private Jenkins jenkins;
@Mock private ExtensionList<MatrixBuildListener> extensions;

@Before
Expand Down Expand Up @@ -239,17 +239,16 @@ private void usingDummyExecution() {

private void usingDummyJenkins() {

PowerMockito.mockStatic(Jenkins.class);
when(Jenkins.getInstance()).thenReturn(jenkins);
when(jenkins.getNodes()).thenReturn(new ArrayList<Node>());
PowerMockito.mockStatic(Whitelist.class);
when(Whitelist.all()).thenReturn(new BlanketWhitelist());
}

private void usingNoListeners() {
private void usingNoListeners() throws Exception {

when(extensions.iterator()).thenReturn(new ArrayList<MatrixBuildListener>().iterator());
when(MatrixBuildListener.all()).thenReturn(extensions);
PowerMockito.mockStatic(MatrixBuildListener.class);
PowerMockito.when(MatrixBuildListener.all()).thenReturn(extensions);
PowerMockito.when(MatrixBuildListener.buildConfiguration(any(MatrixBuild.class), any(MatrixConfiguration.class))).thenCallRealMethod();
}

private void withReleaseAxis(final List<String> releases) {
Expand Down

0 comments on commit 7a675c3

Please sign in to comment.