diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-11-11 15:49:12 -0600 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-09 20:46:15 +0100 |
commit | 4244d2ea76411f80d1ce9da40eefe2781c404327 (patch) | |
tree | fcc91c4905c16139e40a00bf3ae6b2fd4e85caa3 /server/sonar-webserver-core | |
parent | d23f59d1802814dee023ebdc68421db440cde2f2 (diff) | |
download | sonarqube-4244d2ea76411f80d1ce9da40eefe2781c404327.tar.gz sonarqube-4244d2ea76411f80d1ce9da40eefe2781c404327.zip |
SONAR-12679 Use single branch type
Diffstat (limited to 'server/sonar-webserver-core')
2 files changed, 8 insertions, 8 deletions
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java index 5141a356757..c7dd10533ef 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java @@ -59,7 +59,7 @@ import static org.sonar.api.measures.CoreMetrics.LINES_KEY; import static org.sonar.api.measures.CoreMetrics.NCLOC_KEY; import static org.sonar.api.measures.CoreMetrics.NCLOC_LANGUAGE_DISTRIBUTION_KEY; import static org.sonar.core.platform.EditionProvider.Edition.DEVELOPER; -import static org.sonar.db.component.BranchType.LONG; +import static org.sonar.db.component.BranchType.BRANCH; import static org.sonar.db.component.BranchType.PULL_REQUEST; public class TelemetryDataLoaderImplTest { @@ -149,7 +149,7 @@ public class TelemetryDataLoaderImplTest { server.setId("AU-TpxcB-iU5OvuD2FL7").setVersion("7.5.4"); MetricDto ncloc = db.measures().insertMetric(m -> m.setKey(NCLOC_KEY)); ComponentDto project = db.components().insertMainBranch(db.getDefaultOrganization()); - ComponentDto branch1 = db.components().insertProjectBranch(project, b -> b.setBranchType(LONG)); + ComponentDto branch1 = db.components().insertProjectBranch(project, b -> b.setBranchType(BRANCH)); ComponentDto pr = db.components().insertProjectBranch(project, b -> b.setBranchType(PULL_REQUEST)); db.measures().insertLiveMeasure(project, ncloc, m -> m.setValue(10d)); db.measures().insertLiveMeasure(branch1, ncloc, m -> m.setValue(20d)); diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/webhook/WebhookQGChangeEventListenerTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/webhook/WebhookQGChangeEventListenerTest.java index 1f33d63519b..cbc18717ad6 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/webhook/WebhookQGChangeEventListenerTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/webhook/WebhookQGChangeEventListenerTest.java @@ -65,7 +65,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import static org.sonar.core.util.stream.MoreCollectors.toArrayList; -import static org.sonar.db.component.BranchType.LONG; +import static org.sonar.db.component.BranchType.BRANCH; import static org.sonar.db.component.ComponentTesting.newBranchDto; import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto; @@ -146,7 +146,7 @@ public class WebhookQGChangeEventListenerTest { public void onIssueChanges_calls_webhook_for_changeEvent_with_webhook_enabled(@Nullable EvaluatedQualityGate newQualityGate) { OrganizationDto organization = dbTester.organizations().insert(); ComponentDto project = dbTester.components().insertPublicProject(organization); - ComponentAndBranch branch = insertProjectBranch(project, BranchType.LONG, "foo"); + ComponentAndBranch branch = insertProjectBranch(project, BRANCH, "foo"); SnapshotDto analysis = insertAnalysisTask(branch); Configuration configuration = mock(Configuration.class); mockPayloadSupplierConsumedByWebhooks(); @@ -165,7 +165,7 @@ public class WebhookQGChangeEventListenerTest { new Project(project.uuid(), project.getKey(), project.name()), null, new Analysis(analysis.getUuid(), analysis.getCreatedAt(), analysis.getRevision()), - new Branch(false, "foo", Branch.Type.LONG), + new Branch(false, "foo", Branch.Type.BRANCH), newQualityGate, null, properties)); @@ -187,8 +187,8 @@ public class WebhookQGChangeEventListenerTest { } @Test - public void onIssueChanges_calls_webhook_on_long_branch() { - onIssueChangesCallsWebhookOnBranch(BranchType.LONG); + public void onIssueChanges_calls_webhook_on_branch() { + onIssueChangesCallsWebhookOnBranch(BRANCH); } @Test @@ -277,7 +277,7 @@ public class WebhookQGChangeEventListenerTest { public ComponentAndBranch insertMainBranch(OrganizationDto organization) { ComponentDto project = newPrivateProjectDto(organization); - BranchDto branch = newBranchDto(project, LONG).setKey("master"); + BranchDto branch = newBranchDto(project, BRANCH).setKey("master"); dbTester.components().insertComponent(project); dbClient.branchDao().insert(dbTester.getSession(), branch); dbTester.commit(); |