diff options
author | Guillaume Jambet <guillaume.jambet@sonarsource.com> | 2018-05-29 12:47:50 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-06-06 20:20:51 +0200 |
commit | e3d566bbf2436a4bec3a8048f97f5ccca97936c9 (patch) | |
tree | a5248ebfdf11e9aa4e12ee0e407f1c529b4f24e6 /sonar-scanner-engine/src/test | |
parent | 5adcb3760de68b3a80a5a1432a93428d25792f67 (diff) | |
download | sonarqube-e3d566bbf2436a4bec3a8048f97f5ccca97936c9.tar.gz sonarqube-e3d566bbf2436a4bec3a8048f97f5ccca97936c9.zip |
SONAR-9396 remove usage of dashboard/index<project_key> in scanner report
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java index b25f773f536..ccc9d46b1ce 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java @@ -85,7 +85,7 @@ public class ReportPublisherTest { @Before public void setUp() throws IOException { wsClient = mock(ScannerWsClient.class, Mockito.RETURNS_DEEP_STUBS); - root = new DefaultInputModule(ProjectDefinition.create().setKey("struts").setBaseDir(temp.newFolder()).setWorkDir(temp.getRoot())); + root = new DefaultInputModule(ProjectDefinition.create().setKey("org.sonarsource.sonarqube:sonarqube").setBaseDir(temp.newFolder()).setWorkDir(temp.getRoot())); when(moduleHierarchy.root()).thenReturn(root); when(server.getPublicRootUrl()).thenReturn("https://localhost"); when(server.getVersion()).thenReturn("6.4"); @@ -100,17 +100,17 @@ public class ReportPublisherTest { underTest.logSuccess("TASK-123"); assertThat(logTester.logs(LoggerLevel.INFO)) - .contains("ANALYSIS SUCCESSFUL, you can browse https://localhost/dashboard/index/struts") + .contains("ANALYSIS SUCCESSFUL, you can browse https://localhost/dashboard?id=org.sonarsource.sonarqube%3Asonarqube") .contains("Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report") .contains("More about the report processing at https://localhost/api/ce/task?id=TASK-123"); File detailsFile = new File(temp.getRoot(), "report-task.txt"); assertThat(readFileToString(detailsFile)).isEqualTo( "organization=MyOrg\n" + - "projectKey=struts\n" + + "projectKey=org.sonarsource.sonarqube:sonarqube\n" + "serverUrl=https://localhost\n" + "serverVersion=6.4\n" + - "dashboardUrl=https://localhost/dashboard/index/struts\n" + + "dashboardUrl=https://localhost/dashboard?id=org.sonarsource.sonarqube%3Asonarqube\n" + "ceTaskId=TASK-123\n" + "ceTaskUrl=https://localhost/api/ce/task?id=TASK-123\n"); } @@ -138,21 +138,21 @@ public class ReportPublisherTest { underTest.logSuccess("TASK-123"); assertThat(logTester.logs(LoggerLevel.INFO)) - .contains("ANALYSIS SUCCESSFUL, you can browse https://publicserver/sonarqube/dashboard/index/struts") + .contains("ANALYSIS SUCCESSFUL, you can browse https://publicserver/sonarqube/dashboard?id=org.sonarsource.sonarqube%3Asonarqube") .contains("More about the report processing at https://publicserver/sonarqube/api/ce/task?id=TASK-123"); File detailsFile = new File(temp.getRoot(), "report-task.txt"); assertThat(readFileToString(detailsFile)).isEqualTo( - "projectKey=struts\n" + + "projectKey=org.sonarsource.sonarqube:sonarqube\n" + "serverUrl=https://publicserver/sonarqube\n" + "serverVersion=6.4\n" + - "dashboardUrl=https://publicserver/sonarqube/dashboard/index/struts\n" + + "dashboardUrl=https://publicserver/sonarqube/dashboard?id=org.sonarsource.sonarqube%3Asonarqube\n" + "ceTaskId=TASK-123\n" + "ceTaskUrl=https://publicserver/sonarqube/api/ce/task?id=TASK-123\n"); } @Test - public void fail_if_public_url_malformed() throws IOException { + public void fail_if_public_url_malformed() { when(server.getPublicRootUrl()).thenReturn("invalid"); ReportPublisher underTest = new ReportPublisher(settings.asConfig(), wsClient, server, contextPublisher, moduleHierarchy, mode, mock(TempFolder.class), new ReportPublisherStep[0], branchConfiguration); @@ -229,7 +229,7 @@ public class ReportPublisherTest { WsRequest wsRequest = capture.getValue(); assertThat(wsRequest.getParams()).containsOnly( entry("organization", "MyOrg"), - entry("projectKey", "struts")); + entry("projectKey", "org.sonarsource.sonarqube:sonarqube")); } @Test @@ -263,7 +263,7 @@ public class ReportPublisherTest { WsRequest wsRequest = capture.getValue(); assertThat(wsRequest.getParameters().getKeys()).hasSize(3); assertThat(wsRequest.getParameters().getValues("organization")).containsExactly(orgName); - assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("struts"); + assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("org.sonarsource.sonarqube:sonarqube"); assertThat(wsRequest.getParameters().getValues("characteristic")) .containsExactlyInAnyOrder("branch=" + branchName, "branchType=" + SHORT.name()); } @@ -301,7 +301,7 @@ public class ReportPublisherTest { WsRequest wsRequest = capture.getValue(); assertThat(wsRequest.getParameters().getKeys()).hasSize(3); assertThat(wsRequest.getParameters().getValues("organization")).containsExactly(orgName); - assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("struts"); + assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("org.sonarsource.sonarqube:sonarqube"); assertThat(wsRequest.getParameters().getValues("characteristic")) .containsExactlyInAnyOrder("pullRequest=" + pullRequestId); } |