From 7f88c4fe7dc70b5e54faef9b6949ee6bb0dd42ac Mon Sep 17 00:00:00 2001 From: AayushSaini101 Date: Fri, 22 Mar 2024 14:30:49 +0530 Subject: [PATCH] Add header file in the test --- .../DefaultBranchBuildStatusProbeTest.java | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/core/src/test/java/io/jenkins/pluginhealth/scoring/probes/DefaultBranchBuildStatusProbeTest.java b/core/src/test/java/io/jenkins/pluginhealth/scoring/probes/DefaultBranchBuildStatusProbeTest.java index cff4515d8..c9e51df1d 100644 --- a/core/src/test/java/io/jenkins/pluginhealth/scoring/probes/DefaultBranchBuildStatusProbeTest.java +++ b/core/src/test/java/io/jenkins/pluginhealth/scoring/probes/DefaultBranchBuildStatusProbeTest.java @@ -1,17 +1,30 @@ +/* + * 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 { @Override @@ -19,31 +32,4 @@ 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(); - - -// - - - } - }