diff options
author | Lukasz Jarocki <lukasz.jarocki@sonarsource.com> | 2022-10-31 12:25:54 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-11-01 20:03:09 +0000 |
commit | b0be5da0c49b74538dbce98014298a104d4ac5b0 (patch) | |
tree | 6a9b4734fefe01a34ef2b45336276be4fafa1483 /sonar-scanner-engine/src/test/java/org/sonar/scanner | |
parent | b309ce1704e490af7daef2a0d0ab1bbba8c930b8 (diff) | |
download | sonarqube-b0be5da0c49b74538dbce98014298a104d4ac5b0.tar.gz sonarqube-b0be5da0c49b74538dbce98014298a104d4ac5b0.zip |
SONAR-17524 changing default branch name for projects
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner')
4 files changed, 9 insertions, 9 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/branch/BranchMediumTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/branch/BranchMediumTest.java index 83a5bfb888f..52f940f527a 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/branch/BranchMediumTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/branch/BranchMediumTest.java @@ -111,7 +111,7 @@ public class BranchMediumTest { public void shouldSkipSensorForUnchangedFilesOnPr() throws Exception { AnalysisResult result = getResult(tester .setBranchName("myBranch") - .setBranchTarget("master") + .setBranchTarget("main") .setBranchType(BranchType.PULL_REQUEST)); final DefaultInputFile file = (DefaultInputFile) result.inputFile(FILE_PATH); @@ -125,7 +125,7 @@ public class BranchMediumTest { public void shouldNotSkipSensorForUnchangedFilesOnBranch() throws Exception { AnalysisResult result = getResult(tester .setBranchName("myBranch") - .setBranchTarget("master") + .setBranchTarget("main") .setBranchType(BranchType.BRANCH)); final DefaultInputFile file = (DefaultInputFile) result.inputFile(FILE_PATH); diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultNewCodePeriodLoaderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultNewCodePeriodLoaderTest.java index 63766950563..39d98c404e9 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultNewCodePeriodLoaderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultNewCodePeriodLoaderTest.java @@ -47,7 +47,7 @@ public class DefaultNewCodePeriodLoaderTest { } private void prepareCallWithResults() throws IOException { - WsTestUtil.mockStream(wsClient, createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "master")); + WsTestUtil.mockStream(wsClient, createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "main")); } private InputStream createResponse(NewCodePeriods.NewCodePeriodType type, String value) throws IOException { diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ReferenceBranchSupplierTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ReferenceBranchSupplierTest.java index 3b51bd63d61..1b270781d3d 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ReferenceBranchSupplierTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ReferenceBranchSupplierTest.java @@ -64,16 +64,16 @@ public class ReferenceBranchSupplierTest { public void get_returns_reference_branch_when_set() { when(branchConfiguration.branchType()).thenReturn(BranchType.BRANCH); when(branchConfiguration.branchName()).thenReturn(BRANCH_KEY); - when(newCodePeriodLoader.load(PROJECT_KEY, BRANCH_KEY)).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "master")); + when(newCodePeriodLoader.load(PROJECT_KEY, BRANCH_KEY)).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "main")); - assertThat(referenceBranchSupplier.get()).isEqualTo("master"); + assertThat(referenceBranchSupplier.get()).isEqualTo("main"); } @Test public void get_uses_scanner_property_with_higher_priority() { when(branchConfiguration.branchType()).thenReturn(BranchType.BRANCH); when(branchConfiguration.branchName()).thenReturn(BRANCH_KEY); - when(newCodePeriodLoader.load(PROJECT_KEY, BRANCH_KEY)).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "master")); + when(newCodePeriodLoader.load(PROJECT_KEY, BRANCH_KEY)).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "main")); when(configuration.get("sonar.newCode.referenceBranch")).thenReturn(Optional.of("master2")); @@ -107,9 +107,9 @@ public class ReferenceBranchSupplierTest { when(branchConfiguration.branchType()).thenReturn(BranchType.BRANCH); when(branchConfiguration.branchName()).thenReturn(null); when(projectBranches.defaultBranchName()).thenReturn("default"); - when(newCodePeriodLoader.load(PROJECT_KEY, "default")).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "master")); + when(newCodePeriodLoader.load(PROJECT_KEY, "default")).thenReturn(createResponse(NewCodePeriods.NewCodePeriodType.REFERENCE_BRANCH, "main")); - assertThat(referenceBranchSupplier.get()).isEqualTo("master"); + assertThat(referenceBranchSupplier.get()).isEqualTo("main"); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesTest.java index 0c90cc46922..fcf85abca29 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesTest.java @@ -70,6 +70,6 @@ public class ProjectBranchesTest { public void isEmpty() { assertThat(underTest.isEmpty()).isFalse(); assertThat(new ProjectBranches(Collections.emptyList()).isEmpty()).isTrue(); - assertThat(new ProjectBranches(Collections.emptyList()).defaultBranchName()).isEqualTo("master"); + assertThat(new ProjectBranches(Collections.emptyList()).defaultBranchName()).isEqualTo("main"); } } |