.setResponseExample(getClass().getResource("component-example.json"))
.setSince("5.4")
.setChangelog(
+ new Change("10.4", String.format("The metrics %s are now deprecated in the response " +
+ "without exact replacement. Use 'maintainability_issues', 'reliability_issues' and 'security_issues' instead.",
+ MeasuresWsModule.getDeprecatedMetricsInSonarQube104())),
new Change("10.4", "Added new accepted values for the 'metricKeys' param: 'maintainability_issues', 'reliability_issues', 'security_issues'"),
new Change("10.4", "The metrics 'open_issues', 'reopened_issues' and 'confirmed_issues' are now deprecated in the response. Consume 'violations' instead."),
new Change("10.4", "The use of 'open_issues', 'reopened_issues' and 'confirmed_issues' values in 'metricKeys' param are now deprecated. Use 'violations' instead."),
.setHandler(this)
.addPagingParams(100, MAX_SIZE)
.setChangelog(
+ new Change("10.4", String.format("The metrics %s are now deprecated in the response " +
+ "without exact replacement. Use 'maintainability_issues', 'reliability_issues' and 'security_issues' instead.",
+ MeasuresWsModule.getDeprecatedMetricsInSonarQube104())),
new Change("10.4", "Added new accepted values for the 'metricKeys' param: 'maintainability_issues', 'reliability_issues', 'security_issues'"),
new Change("10.4", "The metrics 'open_issues', 'reopened_issues' and 'confirmed_issues' are now deprecated in the response. Consume 'violations' instead."),
new Change("10.4", "The use of 'open_issues', 'reopened_issues' and 'confirmed_issues' values in 'metricKeys' param are now deprecated. Use 'violations' instead."),
public static String getDeprecatedMetricsInSonarQube93() {
- return String.join(", ", "releasability_effort", "security_rating_effort", "reliability_rating_effort", "security_review_rating_effort",
+ return "'" + String.join("', '", "releasability_effort", "security_rating_effort", "reliability_rating_effort", "security_review_rating_effort",
"maintainability_rating_effort", "last_change_on_maintainability_rating", "last_change_on_releasability_rating", "last_change_on_reliability_rating",
- "last_change_on_security_rating", "last_change_on_security_review_rating");
+ "last_change_on_security_rating", "last_change_on_security_review_rating") + "'";
+ }
+
+ public static String getDeprecatedMetricsInSonarQube104() {
+ return "'" + String.join("', '","bugs", "new_bugs", "vulnerabilities", "new_vulnerabilities",
+ "security_hotspots", "new_security_hotspots", "security_hotspots_reviewed", "new_security_hotspots_reviewed",
+ "code_smells", "new_code_smells") + "'";
}
}
.setResponseExample(getClass().getResource("search-example.json"))
.setHandler(this)
.setChangelog(
+ new Change("10.4", String.format("The metrics %s are now deprecated in the response " +
+ "without exact replacement. Use 'maintainability_issues', 'reliability_issues' and 'security_issues' instead.",
+ MeasuresWsModule.getDeprecatedMetricsInSonarQube104())),
new Change("10.4", "Added new accepted values for the 'metricKeys' param: 'maintainability_issues', 'reliability_issues', 'security_issues'"),
new Change("10.4", "The metrics 'open_issues', 'reopened_issues' and 'confirmed_issues' are now deprecated in the response. Consume 'violations' instead."),
new Change("10.4", "The use of 'open_issues', 'reopened_issues' and 'confirmed_issues' values in 'metricKeys' param are now deprecated. Use 'violations' instead."),
.setResponseExample(getClass().getResource("search_history-example.json"))
.setSince("6.3")
.setChangelog(
+ new Change("10.4", String.format("The metrics %s are now deprecated in the response " +
+ "without exact replacement. Use 'maintainability_issues', 'reliability_issues' and 'security_issues' instead.",
+ MeasuresWsModule.getDeprecatedMetricsInSonarQube104())),
new Change("10.4", "The metrics 'open_issues', 'reopened_issues' and 'confirmed_issues' are now deprecated in the response. Consume 'violations' instead."),
new Change("10.4", "The use of 'open_issues', 'reopened_issues' and 'confirmed_issues' values in 'metricKeys' param are now deprecated. Use 'violations' instead."),
new Change("10.4", "The metric 'wont_fix_issues' is now deprecated in the response. Consume 'accepted_issues' instead."),
new MeasuresWsModule().configure(container);
assertThat(container.getAddedObjects()).hasSize(5);
}
+
+ @Test
+ public void getDeprecatedMetricsInSonarQube104_shouldReturnExactString() {
+ String actual = MeasuresWsModule.getDeprecatedMetricsInSonarQube104();
+
+ assertThat(actual).isEqualTo("'bugs', 'new_bugs', 'vulnerabilities', 'new_vulnerabilities', 'security_hotspots', " +
+ "'new_security_hotspots', 'security_hotspots_reviewed', 'new_security_hotspots_reviewed', 'code_smells', 'new_code_smells'");
+ }
}