Skip to content

Commit

Permalink
Add header file in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSaini101 committed Mar 22, 2024
1 parent 222e8d1 commit 7f88c4f
Showing 1 changed file with 23 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,49 +1,35 @@
/*
* MIT License
*
* Copyright (c) 2023 Jenkins Infra
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
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 7f88c4f

Please sign in to comment.