File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/java/org/gridsuite/useradmin/server/service
test/java/org/gridsuite/useradmin/server Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,6 @@ public List<ConnectionEntity> getConnections(String userId) {
52
52
return connectionsService .removeDuplicates ();
53
53
}
54
54
55
- public static <T > Predicate <T > distinctByKey (Function <? super T , ?> keyExtractor ) {
56
- Set <Object > seen = ConcurrentHashMap .newKeySet ();
57
- return t -> seen .add (keyExtractor .apply (t ));
58
- }
59
-
60
55
public void createUser (String sub , String userId ) {
61
56
if (!isAdmin (userId )) {
62
57
throw new UserAdminException (FORBIDDEN );
Original file line number Diff line number Diff line change @@ -213,5 +213,10 @@ public void testGetConnections() throws Exception {
213
213
new TypeReference <>() {
214
214
});
215
215
assertEquals (2 , connectionEntities .size ());
216
+
217
+ mockMvc .perform (get ("/" + UserAdminApi .API_VERSION + "/users" )
218
+ .header ("userId" , NOT_ADMIN )
219
+ .contentType (APPLICATION_JSON ))
220
+ .andExpect (status ().isForbidden ());
216
221
}
217
222
}
You can’t perform that action at this time.
0 commit comments