Skip to content

Commit 8d5f12d

Browse files
adjust group service client
1 parent e95d7ce commit 8d5f12d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

service/src/main/java/com/appirio/service/review/util/GroupServiceClient.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,10 @@ public Set<Long> getGroups(long userId) throws Exception {
7676
throw new SupplyException("Unable to get groups from the API, the returned status code is: " + response.getStatusInfo().getStatusCode());
7777
}
7878

79-
JsonNode apiResponse = response.readEntity(JsonNode.class);
80-
JsonNode result = apiResponse.path("result");
81-
if (result.path("status").asInt() != HttpStatus.OK_200) {
82-
LOGGER.error("Unable to get groups: {}", apiResponse);
83-
84-
throw new SupplyException("Unable to get groups from the API, the error is: " + result.path("content").asText());
85-
}
86-
87-
JsonNode groups = result.path("content");
79+
JsonNode result = response.readEntity(JsonNode.class);
8880
Set<Long> groupIds = new HashSet<Long>();
89-
for (JsonNode group : groups) {
90-
groupIds.add(group.path("id").asLong());
81+
for (JsonNode group : result) {
82+
groupIds.add(group.asLong());
9183
}
9284

9385
return groupIds;

0 commit comments

Comments
 (0)