forked from Praqma/config-rotator-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Test for JENKINS-28983
- Loading branch information
1 parent
f3fcb30
commit ef86ba7
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...t/java/net/praqma/jenkins/configrotator/unit/scm/clearcase/ClearCaseUCMPostBuildTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package net.praqma.jenkins.configrotator.unit.scm.clearcase; | ||
|
||
import hudson.model.TaskListener; | ||
import net.praqma.jenkins.configrotator.AbstractConfiguration; | ||
import net.praqma.jenkins.configrotator.ConfigurationRotatorBuildAction; | ||
import net.praqma.jenkins.configrotator.scm.clearcaseucm.ClearCaseUCMConfiguration; | ||
import net.praqma.jenkins.configrotator.scm.clearcaseucm.ClearCaseUCMPostBuild; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
import org.junit.Test; | ||
import org.mockito.Mockito; | ||
|
||
/** | ||
* | ||
* @author Mads | ||
*/ | ||
public class ClearCaseUCMPostBuildTest { | ||
|
||
@Test | ||
public void testBasicPerform() { | ||
TaskListener listener = Mockito.mock(TaskListener.class); | ||
Mockito.when(listener.getLogger()).thenReturn(System.out); | ||
|
||
ConfigurationRotatorBuildAction ac = Mockito.mock(ConfigurationRotatorBuildAction.class); | ||
AbstractConfiguration a = new ClearCaseUCMConfiguration(); | ||
Mockito.when(ac.getConfiguration()).thenReturn(a); | ||
|
||
ClearCaseUCMPostBuild postbuilder = new ClearCaseUCMPostBuild(); | ||
boolean res = postbuilder.perform(null, listener, ac); | ||
assertThat(res, is(true)); | ||
} | ||
} |