aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client/src/test
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-05-29 22:02:23 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-05-29 22:02:23 +0200
commit371ab065edbef2e92b502878eec9a73d310af54b (patch)
tree4e85b007f2cc55c7bb2f124f771bd7cb530b2fd6 /sonar-ws-client/src/test
parentf06fb0fad22f4f64dbe95d5ad5e413dd0fb4869e (diff)
downloadsonarqube-371ab065edbef2e92b502878eec9a73d310af54b.tar.gz
sonarqube-371ab065edbef2e92b502878eec9a73d310af54b.zip
Fix some quality flaws
Diffstat (limited to 'sonar-ws-client/src/test')
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java (renamed from sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java)16
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java3
2 files changed, 11 insertions, 8 deletions
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
index 7f0a76ecb4d..82c71f7446d 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueParserTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
@@ -28,11 +28,11 @@ import java.util.List;
import static org.fest.assertions.Assertions.assertThat;
-public class IssueParserTest {
+public class IssueJsonParserTest {
@Test
public void test_GET_search() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/search.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues).isNotNull();
List<Issue> list = issues.list();
assertThat(list).hasSize(2);
@@ -84,7 +84,7 @@ public class IssueParserTest {
@Test
public void test_GET_empty_search() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/empty.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues).isNotNull();
assertThat(issues.list()).isEmpty();
assertThat(issues.rules()).isEmpty();
@@ -94,7 +94,7 @@ public class IssueParserTest {
@Test
public void test_GET_transitions() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/getTransitions.json"));
- List<String> transitions = new IssueParser().parseTransitions(json);
+ List<String> transitions = new IssueJsonParser().parseTransitions(json);
assertThat(transitions).isNotNull();
assertThat(transitions).hasSize(2);
@@ -104,7 +104,7 @@ public class IssueParserTest {
@Test
public void should_parse_comments() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/issue-with-comments.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues.size()).isEqualTo(1);
Issue issue = issues.list().get(0);
@@ -126,7 +126,7 @@ public class IssueParserTest {
@Test
public void should_parse_users() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/issue-with-users.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues.users()).hasSize(2);
@@ -146,7 +146,7 @@ public class IssueParserTest {
@Test
public void should_parse_components() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/issue-with-components.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues.components()).hasSize(1);
@@ -160,7 +160,7 @@ public class IssueParserTest {
@Test
public void should_parse_projects() throws Exception {
String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/IssueParserTest/issue-with-projects.json"));
- Issues issues = new IssueParser().parseIssues(json);
+ Issues issues = new IssueJsonParser().parseIssues(json);
assertThat(issues.projects()).hasSize(1);
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java
index 475e95c4f70..d42a0256f08 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java
@@ -53,5 +53,8 @@ public class UserQueryTest {
public void should_search_by_text() throws Exception {
UserQuery query = UserQuery.create().searchText("sim");
assertThat(query.urlParams().get("s")).isEqualTo("sim");
+
+ query = UserQuery.create().searchText("sim").searchText(null);
+ assertThat(query.urlParams().get("s")).isNull();
}
}