aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-02-05 09:56:23 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-02-05 09:56:23 +0100
commit36550e744bbcaaa5b0de6aa8c6b8932d1ef8a551 (patch)
tree5a71f207c10e226dead5f526fe0e4f26a241dc08 /server
parenteb64f5e0e1e9abcd2701ab7a02624341b3d8960d (diff)
downloadsonarqube-36550e744bbcaaa5b0de6aa8c6b8932d1ef8a551.tar.gz
sonarqube-36550e744bbcaaa5b0de6aa8c6b8932d1ef8a551.zip
SONAR-6987 WS api/tests/list improve description and fix typo
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/test/ws/ListAction.java17
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java10
2 files changed, 19 insertions, 8 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/test/ws/ListAction.java b/server/sonar-server/src/main/java/org/sonar/server/test/ws/ListAction.java
index 0087e4c0f5b..886e04927f9 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/test/ws/ListAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/test/ws/ListAction.java
@@ -76,16 +76,17 @@ public class ListAction implements TestsWsAction {
public void define(WebService.NewController controller) {
WebService.NewAction action = controller
.createAction("list")
- .setDescription(
- "Get the list of tests.<br /> " +
- "Require Browse permission on file's project.<br /> " +
+ .setDescription(String.format(
+ "Get the list of tests either in a test file or that test a given line of source code.<br /> " +
+ "Require Browse permission on the file's project.<br /> " +
"One (and only one) of the following combination of parameters must be provided: " +
"<ul>" +
- "<li>" + TEST_FILE_ID + "</li>" +
- "<li>" + TEST_ID + "</li>" +
- "<li>" + SOURCE_FILE_ID + " and " + SOURCE_FILE_LINE_NUMBER + "</li>" +
- "<li>" + SOURCE_FILE_KEY + "and" + SOURCE_FILE_LINE_NUMBER + "</li>" +
- "</ul>")
+ "<li>%s - get a specific test</li>" +
+ "<li>%s - get the tests in a test file</li>" +
+ "<li>%s - get the tests in a test file</li>" +
+ "<li>%s and %6$s - get the tests that cover a specific line of code</li>" +
+ "<li>%s and %6$s - get the tests that cover a specific line of code</li>" +
+ "</ul>", TEST_ID, TEST_FILE_ID, TEST_FILE_KEY, SOURCE_FILE_ID, SOURCE_FILE_KEY, SOURCE_FILE_LINE_NUMBER))
.setSince("5.2")
.setResponseExample(Resources.getResource(getClass(), "tests-example-list.json"))
.setHandler(this)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java
index f5fcb86ff13..2626c1204f5 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java
@@ -63,6 +63,16 @@ public class TestsWsTest {
assertThat(action.handler()).isNotNull();
assertThat(action.responseExampleAsString()).isNotEmpty();
assertThat(action.params()).hasSize(8);
+ assertThat(action.description()).isEqualTo("Get the list of tests either in a test file or that test a given line of source code.<br /> " +
+ "Require Browse permission on the file's project.<br /> " +
+ "One (and only one) of the following combination of parameters must be provided: " +
+ "<ul>" +
+ "<li>testId - get a specific test</li>" +
+ "<li>testFileId - get the tests in a test file</li>" +
+ "<li>testFileKey - get the tests in a test file</li>" +
+ "<li>sourceFileId and sourceFileLineNumber - get the tests that cover a specific line of code</li>" +
+ "<li>sourceFileKey and sourceFileLineNumber - get the tests that cover a specific line of code</li>" +
+ "</ul>");
}
@Test