diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-02-17 11:37:02 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-02-17 11:37:02 +0100 |
commit | 3d8248cb69680296d02a4c3141beccc2517fac87 (patch) | |
tree | 474d873ebb6f8724f6344160af958a2b2287c27e /sonar-plugin-api | |
parent | a914082d1e284d97f6d1d632ab04e8ba4eff30f7 (diff) | |
download | sonarqube-3d8248cb69680296d02a4c3141beccc2517fac87.tar.gz sonarqube-3d8248cb69680296d02a4c3141beccc2517fac87.zip |
SONAR-8777 Rename WS history to changelog
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Change.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Changelog.java) | 4 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java | 16 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/server/ws/WebServiceTest.java | 12 |
3 files changed, 16 insertions, 16 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Changelog.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Change.java index f2e3177d605..c1cfbecb16a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Changelog.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Change.java @@ -28,11 +28,11 @@ import javax.annotation.concurrent.Immutable; * @since 6.4 */ @Immutable -public class Changelog { +public class Change { private final String version; private final String description; - public Changelog(String version, String description) { + public Change(String version, String description) { this.version = version; this.description = description; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java index c6a8b538839..61a6bfe04a6 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java @@ -256,7 +256,7 @@ public interface WebService extends Definable<WebService.Context> { private RequestHandler handler; private Map<String, NewParam> newParams = Maps.newHashMap(); private URL responseExample = null; - private List<Changelog> history = new ArrayList<>(); + private List<Change> changelog = new ArrayList<>(); private NewAction(String key) { this.key = key; @@ -336,8 +336,8 @@ public interface WebService extends Definable<WebService.Context> { * * @since 6.4 */ - public NewAction setHistory(Changelog... changelogs) { - this.history = Arrays.stream(requireNonNull(changelogs)) + public NewAction setChangelog(Change... changes) { + this.changelog = Arrays.stream(requireNonNull(changes)) .filter(Objects::nonNull) .collect(Collectors.toList()); @@ -489,7 +489,7 @@ public interface WebService extends Definable<WebService.Context> { private final RequestHandler handler; private final Map<String, Param> params; private final URL responseExample; - private final List<Changelog> history; + private final List<Change> changelog; private Action(Controller controller, NewAction newAction) { this.key = newAction.key; @@ -502,7 +502,7 @@ public interface WebService extends Definable<WebService.Context> { this.isInternal = newAction.isInternal; this.responseExample = newAction.responseExample; this.handler = newAction.handler; - this.history = newAction.history; + this.changelog = newAction.changelog; checkState(this.handler != null, "RequestHandler is not set on action %s", path); logWarningIf(isNullOrEmpty(this.description), "Description is not set on action " + path); @@ -557,11 +557,11 @@ public interface WebService extends Definable<WebService.Context> { } /** - * @see NewAction#setHistory(Changelog...) + * @see NewAction#setChangelog(Change...) * @since 6.4 */ - public List<Changelog> history() { - return history; + public List<Change> changelog() { + return changelog; } /** diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/WebServiceTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/WebServiceTest.java index a91cae06d17..6942526c3d5 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/WebServiceTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/ws/WebServiceTest.java @@ -75,7 +75,7 @@ public class WebServiceTest { assertThat(showAction.responseExampleFormat()).isNotEmpty(); assertThat(showAction.responseExampleAsString()).isNotEmpty(); assertThat(showAction.deprecatedSince()).isNull(); - assertThat(showAction.history()).isEmpty(); + assertThat(showAction.changelog()).isEmpty(); // same as controller assertThat(showAction.since()).isEqualTo("4.2"); assertThat(showAction.isPost()).isFalse(); @@ -90,7 +90,7 @@ public class WebServiceTest { assertThat(createAction.since()).isEqualTo("4.1"); assertThat(createAction.isPost()).isTrue(); assertThat(createAction.isInternal()).isTrue(); - assertThat(createAction.history()).extracting(Changelog::getVersion, Changelog::getDescription).containsOnly( + assertThat(createAction.changelog()).extracting(Change::getVersion, Change::getDescription).containsOnly( tuple("6.4", "Last event"), tuple("6.0", "Old event"), tuple("4.5.6", "Very old event")); } @@ -470,10 +470,10 @@ public class WebServiceTest { .setPost(true) .setInternal(true) .setResponseExample(getClass().getResource("WebServiceTest/response-example.txt")) - .setHistory( - new Changelog("6.4", "Last event"), - new Changelog("6.0", "Old event"), - new Changelog("4.5.6", "Very old event")) + .setChangelog( + new Change("6.4", "Last event"), + new Change("6.0", "Old event"), + new Change("4.5.6", "Very old event")) .setHandler(this::create); newController.done(); |