88import org .springframework .test .context .jdbc .Sql ;
99import org .springframework .test .context .jdbc .Sql .ExecutionPhase ;
1010
11+ import java .util .Set ;
12+
1113import static com .faforever .api .data .JsonApiMediaType .JSON_API_MEDIA_TYPE ;
1214import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .get ;
1315import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .patch ;
@@ -128,7 +130,10 @@ public void cannotCreateUserGroupWithoutRole() throws Exception {
128130 @ Test
129131 public void canCreateUserGroupWithScopeAndRole () throws Exception {
130132 mockMvc .perform (post ("/data/userGroup" )
131- .with (getOAuthTokenWithActiveUser (OAuthScope ._ADMINISTRATIVE_ACTION , GroupPermission .ROLE_WRITE_USER_GROUP ))
133+ .with (getOAuthTokenWithActiveUser (
134+ Set .of (OAuthScope ._ADMINISTRATIVE_ACTION , OAuthScope ._READ_SENSIBLE_USERDATA ),
135+ Set .of (GroupPermission .ROLE_WRITE_USER_GROUP , GroupPermission .ROLE_READ_USER_GROUP )
136+ ))
132137 .header (HttpHeaders .CONTENT_TYPE , JSON_API_MEDIA_TYPE )
133138 .content (testPost ))
134139 .andExpect (status ().isCreated ());
@@ -155,7 +160,10 @@ public void cannotUpdateUserGroupWithoutRole() throws Exception {
155160 @ Test
156161 public void canUpdateUserGroupWithScopeAndRole () throws Exception {
157162 mockMvc .perform (patch ("/data/userGroup/3" )
158- .with (getOAuthTokenWithActiveUser (OAuthScope ._ADMINISTRATIVE_ACTION , GroupPermission .ROLE_WRITE_USER_GROUP ))
163+ .with (getOAuthTokenWithActiveUser (
164+ Set .of (OAuthScope ._ADMINISTRATIVE_ACTION , OAuthScope ._READ_SENSIBLE_USERDATA ),
165+ Set .of (GroupPermission .ROLE_WRITE_USER_GROUP , GroupPermission .ROLE_READ_USER_GROUP )
166+ ))
159167 .header (HttpHeaders .CONTENT_TYPE , JSON_API_MEDIA_TYPE )
160168 .content (testPatch ))
161169 .andExpect (status ().isNoContent ());
0 commit comments