-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46eb6c4
commit 222e8d1
Showing
2 changed files
with
50 additions
and
0 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
49 changes: 49 additions & 0 deletions
49
...c/test/java/io/jenkins/pluginhealth/scoring/probes/DefaultBranchBuildStatusProbeTest.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,49 @@ | ||
package io.jenkins.pluginhealth.scoring.probes; | ||
|
||
|
||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.mockito.Mockito.spy; | ||
|
||
import java.io.IOException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.kohsuke.github.GHCommit; | ||
|
||
|
||
|
||
class DefaultBranchBuildStatusProbeTest extends AbstractProbeTest<DefaultBranchBuildStatusProbe> { | ||
|
||
@Override | ||
DefaultBranchBuildStatusProbe getSpy() { | ||
return spy(DefaultBranchBuildStatusProbe.class); | ||
} | ||
|
||
@Test | ||
void shouldNotRequireRelease() { | ||
assertThat(getSpy().requiresRelease()).isFalse(); | ||
} | ||
|
||
@Test | ||
void shouldBeRelatedToCode() { | ||
assertThat(getSpy().isSourceCodeRelated()).isTrue(); | ||
} | ||
|
||
@Test | ||
void shouldVerifyDefaultBranch() throws IOException { | ||
|
||
// final io.jenkins.pluginhealth.scoring.model.Plugin plugin = mock(Plugin.class); | ||
// final ProbeContext ctx = mock(ProbeContext.class); | ||
// when(plugin.getName()).thenReturn("foo"); | ||
// when(ctx.getScmRepository()).thenReturn(Optional.empty()); | ||
// GHRepository ghRepository = new GHRepository(); | ||
// ghRepository.setDefaultBranch("main"); | ||
GHCommit ghCommit = new GHCommit(); | ||
|
||
|
||
// | ||
|
||
|
||
} | ||
|
||
} |