NewAction action = controller.createAction(ACTION_AUTHORS)
.setSince("5.1")
.setDescription("Search SCM accounts which match a given query")
- .setResponseExample(Resources.getResource(this.getClass(), "example-authors.json"))
+ .setResponseExample(Resources.getResource(this.getClass(), "authors-example.json"))
.setHandler(this);
action.createParam(Param.TEXT_QUERY)
"Since 6.3, changes on effort are returning raw value in minutes, it doesn't return anymore the duration.")
.setSince("4.1")
.setHandler(this)
- .setResponseExample(Resources.getResource(IssuesWs.class, "example-changelog.json"));
+ .setResponseExample(Resources.getResource(IssuesWs.class, "changelog-example.json"));
action.createParam(PARAM_ISSUE)
.setDescription("Issue key")
.setRequired(true)
.setSince("5.1")
.setInternal(true)
.setDescription("List tags for the issues under a given component (including issues on the descendants of the component)")
- .setResponseExample(Resources.getResource(getClass(), "example-component-tags.json"));
+ .setResponseExample(Resources.getResource(getClass(), "component-tags-example.json"));
action.createParam(PARAM_COMPONENT_UUID)
.setDescription("A component UUID")
.setRequired(true)
"Since 5.5, response field 'reporter' has been removed, as manual issue feature has been dropped.",
PARAM_COMPONENT_KEYS, PARAM_COMPONENT_UUIDS, PARAM_COMPONENTS, PARAM_COMPONENT_ROOT_UUIDS, PARAM_COMPONENT_ROOTS)
.setSince("3.6")
- .setResponseExample(getClass().getResource("example-search.json"));
+ .setResponseExample(getClass().getResource("search-example.json"));
action.addPagingParams(100, MAX_LIMIT);
action.createParam(Param.FACETS)
.setHandler(this)
.setSince("5.1")
.setDescription("List tags matching a given query")
- .setResponseExample(Resources.getResource(getClass(), "example-tags.json"));
+ .setResponseExample(Resources.getResource(getClass(), "tags-example.json"));
action.createParam(Param.TEXT_QUERY)
.setDescription("A pattern to match tags against")
.setExampleValue("misra");
--- /dev/null
+{
+ "authors": {
+ "more": true,
+ "results": [
+ {
+ "key": "leia.organa",
+ "text": "leia.organa"
+ },
+ {
+ "key": "luke@skywalker.name",
+ "text": "luke@skywalker.name"
+ }
+ ]
+ }
+}
--- /dev/null
+{
+ "changelog": [
+ {
+ "user": "john.smith",
+ "userName": "John Smith",
+ "email": "john@smith.com",
+ "creationDate": "2014-03-04T23:03:44+0100",
+ "diffs": [
+ {
+ "key": "severity",
+ "newValue": "BLOCKER",
+ "oldValue": "MAJOR"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "tags": [
+ { key: "convention", value: 42 },
+ { key: "cwe", value: 12 },
+ { key: "security", value: 5 }
+ ]
+}
\ No newline at end of file
+++ /dev/null
-{
- "authors": {
- "more": true,
- "results": [
- {
- "key": "leia.organa",
- "text": "leia.organa"
- },
- {
- "key": "luke@skywalker.name",
- "text": "luke@skywalker.name"
- }
- ]
- }
-}
+++ /dev/null
-{
- "changelog": [
- {
- "user": "john.smith",
- "userName": "John Smith",
- "email": "john@smith.com",
- "creationDate": "2014-03-04T23:03:44+0100",
- "diffs": [
- {
- "key": "severity",
- "newValue": "BLOCKER",
- "oldValue": "MAJOR"
- }
- ]
- }
- ]
-}
+++ /dev/null
-{
- "tags": [
- { key: "convention", value: 42 },
- { key: "cwe", value: 12 },
- { key: "security", value: 5 }
- ]
-}
\ No newline at end of file
+++ /dev/null
-{
- "paging": {
- "pageIndex": 1,
- "pageSize": 100,
- "total": 1
- },
- "issues": [
- {
- "key": "01fc972e-2a3c-433e-bcae-0bd7f88f5123",
- "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
- "project": "com.github.kevinsawicki:http-request",
- "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
- "status": "RESOLVED",
- "resolution": "FALSE-POSITIVE",
- "severity": "MINOR",
- "message": "'3' is a magic number.",
- "line": 530,
- "textRange": {
- "startLine": 81,
- "endLine": 81,
- "startOffset": 0,
- "endOffset": 134
- },
- "author": "Developer 1",
- "effort": "2h1min",
- "creationDate": "2013-05-13T17:55:39+0200",
- "updateDate": "2013-05-13T17:55:39+0200",
- "tags": ["bug"],
- "type": "RELIABILITY",
- "comments": [
- {
- "key": "7d7c56f5-7b5a-41b9-87f8-36fa70caa5ba",
- "login": "john.smith",
- "htmlText": "Must be "final"!",
- "markdown": "Must be \"final\"!",
- "updatable": false,
- "createdAt": "2013-05-13T18:08:34+0200"
- }
- ],
- "attr": {
- "jira-issue-key": "SONAR-1234"
- },
- "transitions": [
- "unconfirm",
- "resolve",
- "falsepositive"
- ],
- "actions": [
- "comment"
- ]
- }
- ],
- "components": [
- {
- "key": "com.github.kevinsawicki:http-request:src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
- "enabled": true,
- "qualifier": "FIL",
- "name": "HttpRequest.java",
- "longName": "src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
- "path": "src/main/java/com/github/kevinsawicki/http/HttpRequest.java"
- },
- {
- "key": "com.github.kevinsawicki:http-request",
- "enabled": true,
- "qualifier": "TRK",
- "name": "http-request",
- "longName": "http-request"
- }
- ],
- "rules": [
- {
- "key": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
- "name": "Magic Number",
- "status": "READY",
- "lang": "java",
- "langName": "Java"
- }
- ],
- "users": [
- {
- "login": "admin",
- "name": "Administrator",
- "active": true,
- "email": "admin@sonarqube.org"
- }
- ]
-
-}
+++ /dev/null
-{
- "tags": ["convention", "security", "cwe"]
-}
\ No newline at end of file
+++ /dev/null
-{
- "transitions": ["confirm", "resolve", "falsepositive"]
-}
--- /dev/null
+{
+ "paging": {
+ "pageIndex": 1,
+ "pageSize": 100,
+ "total": 1
+ },
+ "issues": [
+ {
+ "key": "01fc972e-2a3c-433e-bcae-0bd7f88f5123",
+ "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
+ "project": "com.github.kevinsawicki:http-request",
+ "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
+ "status": "RESOLVED",
+ "resolution": "FALSE-POSITIVE",
+ "severity": "MINOR",
+ "message": "'3' is a magic number.",
+ "line": 530,
+ "textRange": {
+ "startLine": 81,
+ "endLine": 81,
+ "startOffset": 0,
+ "endOffset": 134
+ },
+ "author": "Developer 1",
+ "effort": "2h1min",
+ "creationDate": "2013-05-13T17:55:39+0200",
+ "updateDate": "2013-05-13T17:55:39+0200",
+ "tags": ["bug"],
+ "type": "RELIABILITY",
+ "comments": [
+ {
+ "key": "7d7c56f5-7b5a-41b9-87f8-36fa70caa5ba",
+ "login": "john.smith",
+ "htmlText": "Must be "final"!",
+ "markdown": "Must be \"final\"!",
+ "updatable": false,
+ "createdAt": "2013-05-13T18:08:34+0200"
+ }
+ ],
+ "attr": {
+ "jira-issue-key": "SONAR-1234"
+ },
+ "transitions": [
+ "unconfirm",
+ "resolve",
+ "falsepositive"
+ ],
+ "actions": [
+ "comment"
+ ]
+ }
+ ],
+ "components": [
+ {
+ "key": "com.github.kevinsawicki:http-request:src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
+ "enabled": true,
+ "qualifier": "FIL",
+ "name": "HttpRequest.java",
+ "longName": "src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
+ "path": "src/main/java/com/github/kevinsawicki/http/HttpRequest.java"
+ },
+ {
+ "key": "com.github.kevinsawicki:http-request",
+ "enabled": true,
+ "qualifier": "TRK",
+ "name": "http-request",
+ "longName": "http-request"
+ }
+ ],
+ "rules": [
+ {
+ "key": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
+ "name": "Magic Number",
+ "status": "READY",
+ "lang": "java",
+ "langName": "Java"
+ }
+ ],
+ "users": [
+ {
+ "login": "admin",
+ "name": "Administrator",
+ "active": true,
+ "email": "admin@sonarqube.org"
+ }
+ ]
+
+}
--- /dev/null
+{
+ "tags": ["convention", "security", "cwe"]
+}
\ No newline at end of file
String result = tester.newRequest().setParam("issue", issueDto.getKey()).execute().getInput();
- assertJson(result).isSimilarTo(getClass().getResource("example-changelog.json"));
+ assertJson(result).isSimilarTo(getClass().getResource("changelog-example.json"));
}
@Test