|
15 | 15 | @Sql(executionPhase = ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:sql/truncateTables.sql") |
16 | 16 | @Sql(executionPhase = ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:sql/prepDefaultData.sql") |
17 | 17 | @Sql(executionPhase = ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:sql/prepMapData.sql") |
18 | | -public class MatchmakerQueueMapPoolElideTest extends AbstractIntegrationTest { |
19 | | - private static final String NEW_LADDER_MAP_BODY = "{\"data\":{\"type\":\"ladder1v1Map\",\"relationships\":{\"mapVersion\":{\"data\":{\"type\":\"mapVersion\",\"id\":\"2\"}}}}}"; |
| 18 | +public class MapPoolElideTest extends AbstractIntegrationTest { |
| 19 | + private static final String NEW_LADDER_MAP_BODY = "{\"data\":{\"type\":\"mapVersion\",\"id\":\"2\"}}}"; |
20 | 20 |
|
21 | 21 | @Test |
22 | | - public void cannotCreateLadderMapWithoutScope() throws Exception { |
| 22 | + public void cannotCreateMapPoolItemWithoutScope() throws Exception { |
23 | 23 | mockMvc.perform( |
24 | | - post("/data/ladder1v1Map") |
| 24 | + post("/data/mapPool/1/mapVersions") |
25 | 25 | .with(getOAuthTokenWithTestUser(NO_SCOPE, GroupPermission.ROLE_WRITE_MATCHMAKER_MAP)) |
26 | 26 | .header(HttpHeaders.CONTENT_TYPE, JsonApiMediaType.JSON_API_MEDIA_TYPE) |
27 | 27 | .content(NEW_LADDER_MAP_BODY)) // magic value from prepMapData.sql |
28 | 28 | .andExpect(status().isForbidden()); |
29 | 29 | } |
30 | 30 |
|
31 | 31 | @Test |
32 | | - public void cannotCreateLadderMapWithoutRole() throws Exception { |
| 32 | + public void cannotCreateMapPoolItemWithoutRole() throws Exception { |
33 | 33 | mockMvc.perform( |
34 | | - post("/data/ladder1v1Map") |
| 34 | + post("/data/mapPool/1/mapVersions") |
35 | 35 | .with(getOAuthTokenWithTestUser(OAuthScope._ADMINISTRATIVE_ACTION, NO_AUTHORITIES)) |
36 | 36 | .header(HttpHeaders.CONTENT_TYPE, JsonApiMediaType.JSON_API_MEDIA_TYPE) |
37 | 37 | .content(NEW_LADDER_MAP_BODY)) // magic value from prepMapData.sql |
38 | 38 | .andExpect(status().isForbidden()); |
39 | 39 | } |
40 | 40 |
|
41 | 41 | @Test |
42 | | - public void canCreateLadderMapWithScopeAndRole() throws Exception { |
| 42 | + public void canCreateMapPoolItemWithScopeAndRole() throws Exception { |
43 | 43 | mockMvc.perform( |
44 | | - post("/data/ladder1v1Map") |
| 44 | + post("/data/mapPool/1/mapVersions") |
45 | 45 | .with(getOAuthTokenWithTestUser(OAuthScope._ADMINISTRATIVE_ACTION, GroupPermission.ROLE_WRITE_MATCHMAKER_MAP)) |
46 | 46 | .header(HttpHeaders.CONTENT_TYPE, JsonApiMediaType.JSON_API_MEDIA_TYPE) |
47 | 47 | .content(NEW_LADDER_MAP_BODY)) // magic value from prepMapData.sql |
48 | 48 | .andExpect(status().isCreated()); |
49 | 49 | } |
50 | 50 |
|
51 | 51 | @Test |
52 | | - public void canDeleteLadderMapWithScopeAndRole() throws Exception { |
| 52 | + public void canDeleteMapPoolItemWithScopeAndRole() throws Exception { |
53 | 53 | mockMvc.perform( |
54 | | - delete("/data/ladder1v1Map/1") |
| 54 | + delete("/data/mapPool/1/mapVersions/1") |
55 | 55 | .with(getOAuthTokenWithTestUser(OAuthScope._ADMINISTRATIVE_ACTION, GroupPermission.ROLE_WRITE_MATCHMAKER_MAP))) // magic value from prepMapData.sql |
56 | 56 | .andExpect(status().isNoContent()); |
57 | 57 | } |
58 | 58 |
|
59 | 59 | @Test |
60 | | - public void cannotDeleteLadderMapWithoutScope() throws Exception { |
| 60 | + public void cannotDeleteMapPoolItemWithoutScope() throws Exception { |
61 | 61 | mockMvc.perform( |
62 | | - delete("/data/ladder1v1Map/1") |
| 62 | + delete("/data/mapPool/1/mapVersions/1") |
63 | 63 | .with(getOAuthTokenWithTestUser(NO_SCOPE, GroupPermission.ROLE_WRITE_MATCHMAKER_MAP))) // magic value from prepMapData.sql |
64 | 64 | .andExpect(status().isForbidden()); |
65 | 65 | } |
66 | 66 |
|
67 | 67 | @Test |
68 | | - public void cannotDeleteLadderMapWithoutRole() throws Exception { |
| 68 | + public void cannotDeleteMapPoolItemWithoutRole() throws Exception { |
69 | 69 | mockMvc.perform( |
70 | | - delete("/data/ladder1v1Map/1") |
| 70 | + delete("/data/mapPool/1") |
71 | 71 | .with(getOAuthTokenWithTestUser(OAuthScope._ADMINISTRATIVE_ACTION, NO_AUTHORITIES))) // magic value from prepMapData.sql |
72 | 72 | .andExpect(status().isForbidden()); |
73 | 73 | } |
|
0 commit comments