-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix global timeout logging for Abstract Project issue (#105)
- Loading branch information
Showing
6 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
.../hudson/plugins/build_timeout/global/GlobalTimeOutRunListenerForAbstractProjectsTest.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 @@ | ||
package hudson.plugins.build_timeout.global; | ||
|
||
import hudson.model.AbstractProject; | ||
import hudson.model.BuildListener; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.MockitoJUnit; | ||
import org.mockito.junit.MockitoRule; | ||
import org.mockito.quality.Strictness; | ||
|
||
import java.util.Optional; | ||
|
||
import static org.mockito.BDDMockito.given; | ||
import static org.mockito.Mockito.verifyNoInteractions; | ||
|
||
public class GlobalTimeOutRunListenerForAbstractProjectsTest { | ||
@Rule | ||
public MockitoRule rule = MockitoJUnit.rule().strictness(Strictness.LENIENT); | ||
@Mock | ||
private TimeOutProvider timeOutProvider; | ||
@Mock | ||
private TimeOutStore timeOutStore; | ||
|
||
@Mock | ||
private AbstractProject<?, ?> build; | ||
|
||
@Mock | ||
private BuildListener buildListener; | ||
|
||
@Test | ||
public void shouldNotStoreForMatrixProjects() { | ||
given(timeOutProvider.timeOutFor(build, buildListener)).willReturn(Optional.empty()); | ||
|
||
verifyNoInteractions(timeOutStore); | ||
} | ||
} |