CAS Part 2

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2020-12-03 16:57:53 +01:00
parent 3ebfda5316
commit 453907782a
7 changed files with 51 additions and 53 deletions

View File

@ -36,8 +36,8 @@ public class AssignmentsControllerTest extends AbstractControllerTest {
@Test
public void shouldReturnOk() throws Exception {
this.service.save(new User(null, null, TEST_MAIL, UserRoles.TEST_USER));
final String token = this.service.login(TEST_MAIL);
final User newuser = this.service.save(new User(null, null, TEST_MAIL, UserRoles.TEST_USER));
final String token = this.service.login(newuser);
MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
mockMvc.perform(get(ASSIGFNMENTS_ENDPOINT).header("Authorization", "Bearer " + token))