test
This commit is contained in:
parent
ad3d4e6900
commit
2d28abefea
@ -47,6 +47,7 @@ public class CommisionControllerTest extends AbstractControllerTest {
|
|||||||
private static final String GET_COMMISIONS_ENDPOINT = "/api/v1/commisions/user";
|
private static final String GET_COMMISIONS_ENDPOINT = "/api/v1/commisions/user";
|
||||||
private static final String GET_SOMEONE_COMMISIONS_ENDPOINT = "/api/v1/commisions/user";
|
private static final String GET_SOMEONE_COMMISIONS_ENDPOINT = "/api/v1/commisions/user";
|
||||||
private static final String GET_USER_SCHEDULE_ENDPOINT = "/api/v1/commisions/user/schedule";
|
private static final String GET_USER_SCHEDULE_ENDPOINT = "/api/v1/commisions/user/schedule";
|
||||||
|
private static final String GET_ASSIGNMENTS_ENDPOINT = "/api/v1/commisions/user/assignments";
|
||||||
|
|
||||||
private static final String EXPORT_DATA = "/api/v1/commisions/export/csv";
|
private static final String EXPORT_DATA = "/api/v1/commisions/export/csv";
|
||||||
|
|
||||||
@ -307,4 +308,16 @@ public class CommisionControllerTest extends AbstractControllerTest {
|
|||||||
mockMvc.perform(get(EXPORT_DATA).header("Authorization", "Bearer " + token)).andExpect(status().isOk())
|
mockMvc.perform(get(EXPORT_DATA).header("Authorization", "Bearer " + token)).andExpect(status().isOk())
|
||||||
.andReturn().getResponse().getContentAsString().contains("user_id, zaj_cykl_id, gr_nr"));
|
.andReturn().getResponse().getContentAsString().contains("user_id, zaj_cykl_id, gr_nr"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void shouldRetrunOkForAssignmentEnpoint() throws Exception {
|
||||||
|
this.checkUsers();
|
||||||
|
final User admin = this.service.checkForUser(TEST_COMMISIONS_STUDENT_EMAIL, null);
|
||||||
|
final String token = this.service.login(admin).getToken();
|
||||||
|
|
||||||
|
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
|
||||||
|
|
||||||
|
mockMvc.perform(get(GET_ASSIGNMENTS_ENDPOINT).header("Authorization", "Bearer " + token))
|
||||||
|
.andExpect(status().isOk());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user