// verify properties
Properties props = new Properties();
props.load(new StringReader(FileUtils.readFileToString(metadata, StandardCharsets.UTF_8)));
- assertThat(props).hasSize(4);
+ assertThat(props).hasSize(5);
assertThat(props.getProperty("projectKey")).isEqualTo("dump_metadata_of_uploaded_report");
assertThat(props.getProperty("ceTaskId")).isNotEmpty();
+ verifyUrl(props.getProperty("serverUrl"));
verifyUrl(props.getProperty("dashboardUrl"));
verifyUrl(props.getProperty("ceTaskUrl"));
}
Map<String, String> metadata = new LinkedHashMap<>();
String effectiveKey = projectReactor.getRoot().getKeyWithBranch();
metadata.put("projectKey", effectiveKey);
-
+ metadata.put("serverUrl", publicUrl());
+
URL dashboardUrl = HttpUrl.parse(publicUrl()).newBuilder()
.addPathSegment("dashboard").addPathSegment("index").addPathSegment(effectiveKey)
.build()
File detailsFile = new File(temp.getRoot(), "report-task.txt");
assertThat(readFileToString(detailsFile)).isEqualTo(
"projectKey=struts\n" +
+ "serverUrl=https://localhost/\n" +
"dashboardUrl=https://localhost/dashboard/index/struts\n" +
"ceTaskId=TASK-123\n" +
"ceTaskUrl=https://localhost/api/ce/task?id=TASK-123\n"
File detailsFile = new File(temp.getRoot(), "report-task.txt");
assertThat(readFileToString(detailsFile)).isEqualTo(
"projectKey=struts\n" +
+ "serverUrl=https://publicserver/sonarqube/\n" +
"dashboardUrl=https://publicserver/sonarqube/dashboard/index/struts\n" +
"ceTaskId=TASK-123\n" +
"ceTaskUrl=https://publicserver/sonarqube/api/ce/task?id=TASK-123\n"