aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-20 12:06:06 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-20 12:06:06 +0100
commitcd9788930b2c6898db00b9df5f0c2dfd796b8d9e (patch)
tree954663c414b7e43afe15dd16a52a94398d137ee1 /server
parent0ae5844018f67dcdfc2c72251164b72048ba7392 (diff)
downloadsonarqube-cd9788930b2c6898db00b9df5f0c2dfd796b8d9e.tar.gz
sonarqube-cd9788930b2c6898db00b9df5f0c2dfd796b8d9e.zip
SONAR-7210 WS user_tokens/search tokenCount replaced by tokensCount in response
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java10
-rw-r--r--server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json4
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json10
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json2
-rw-r--r--server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs2
5 files changed, 14 insertions, 14 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java b/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java
index e19fbdba8aa..b4711a075fd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java
@@ -40,7 +40,7 @@ public class UserJsonWriter {
private static final String FIELD_SCM_ACCOUNTS = "scmAccounts";
private static final String FIELD_GROUPS = "groups";
private static final String FIELD_ACTIVE = "active";
- private static final String FIELD_TOKEN_COUNT = "tokenCount";
+ private static final String FIELD_TOKENS_COUNT = "tokensCount";
public static final Set<String> FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_SCM_ACCOUNTS, FIELD_GROUPS, FIELD_ACTIVE);
private static final Set<String> CONCISE_FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_ACTIVE);
@@ -61,7 +61,7 @@ public class UserJsonWriter {
/**
* Serializes a user to the passed JsonWriter.
*/
- public void write(JsonWriter json, User user, @Nullable Integer tokenCount, Collection<String> groups, @Nullable Collection<String> fields) {
+ public void write(JsonWriter json, User user, @Nullable Integer tokensCount, Collection<String> groups, @Nullable Collection<String> fields) {
json.beginObject();
json.prop(FIELD_LOGIN, user.login());
writeIfNeeded(json, user.name(), FIELD_NAME, fields);
@@ -69,7 +69,7 @@ public class UserJsonWriter {
writeIfNeeded(json, user.active(), FIELD_ACTIVE, fields);
writeGroupsIfNeeded(json, groups, fields);
writeScmAccountsIfNeeded(json, fields, user);
- writeTokenCount(json, tokenCount);
+ writeTokensCount(json, tokensCount);
json.endObject();
}
@@ -103,11 +103,11 @@ public class UserJsonWriter {
}
}
- private static void writeTokenCount(JsonWriter json, @Nullable Integer tokenCount) {
+ private static void writeTokensCount(JsonWriter json, @Nullable Integer tokenCount) {
if (tokenCount == null) {
return;
}
- json.prop(FIELD_TOKEN_COUNT, tokenCount);
+ json.prop(FIELD_TOKENS_COUNT, tokenCount);
}
}
diff --git a/server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json b/server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json
index 43f791d247f..9f6ad704d55 100644
--- a/server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json
+++ b/server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json
@@ -10,7 +10,7 @@
"sonar-users",
"sonar-administrators"
],
- "tokenCount": 1
+ "tokensCount": 1
},
{
"login": "sbrandhof",
@@ -24,7 +24,7 @@
"groups": [
"sonar-users"
],
- "tokenCount": 3
+ "tokensCount": 3
}
]
}
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json b/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json
index 576b41ad6ce..53f48b5066c 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json
+++ b/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json
@@ -10,7 +10,7 @@
"scmAccounts": [
"user-0"
],
- "tokenCount": 0
+ "tokensCount": 0
},
{
"login": "user-1",
@@ -19,7 +19,7 @@
"scmAccounts": [
"user-1"
],
- "tokenCount": 1
+ "tokensCount": 1
},
{
"login": "user-2",
@@ -28,7 +28,7 @@
"scmAccounts": [
"user-2"
],
- "tokenCount": 2
+ "tokensCount": 2
},
{
"login": "user-3",
@@ -37,7 +37,7 @@
"scmAccounts": [
"user-3"
],
- "tokenCount": 3
+ "tokensCount": 3
},
{
"login": "user-4",
@@ -46,7 +46,7 @@
"scmAccounts": [
"user-4"
],
- "tokenCount": 4
+ "tokensCount": 4
}
]
}
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json b/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json
index 2f3d06e9ac6..87f7c37c97b 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json
+++ b/server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json
@@ -10,7 +10,7 @@
"scmAccounts": [
"user-1"
],
- "tokenCount": 1
+ "tokensCount": 1
}
]
}
diff --git a/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs b/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs
index 771d5c987bc..fb5987fbbd8 100644
--- a/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs
+++ b/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs
@@ -40,7 +40,7 @@
</td>
<td>
- {{tokenCount}}
+ {{tokensCount}}
<a class="js-user-tokens spacer-left icon-bullet-list" title="Update Tokens" data-toggle="tooltip" href="#"></a>
</td>