Skip to content

Commit

Permalink
Update probe
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSaini101 committed Mar 22, 2024
1 parent 46eb6c4 commit 222e8d1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected ProbeResult doApply(Plugin plugin, ProbeContext context) {
}

}

@Override
public String key() {
return KEY;
Expand Down
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();


//


}

}

0 comments on commit 222e8d1

Please sign in to comment.