Added missing context.restoreAuthSystemState

This commit is contained in:
Raf Ponsaerts
2019-03-05 14:17:08 +01:00
parent 800f254677
commit 033790e1b2

View File

@@ -442,6 +442,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
context.restoreAuthSystemState();
String token = getAuthToken(admin.getEmail(), password);
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
@@ -536,6 +538,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
authorizeService.addPolicy(context, author1, Constants.WRITE, user);
authorizeService.addPolicy(context, author2, Constants.WRITE, user);
context.restoreAuthSystemState();
String token = getAuthToken(user.getEmail(), password);
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
@@ -629,6 +633,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
authorizeService.addPolicy(context, publication, Constants.WRITE, user);
context.restoreAuthSystemState();
String token = getAuthToken(user.getEmail(), password);
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
@@ -730,6 +736,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
authorizeService.addPolicy(context, publication1, Constants.WRITE, user);
authorizeService.addPolicy(context, publication2, Constants.WRITE, user);
context.restoreAuthSystemState();
String token = getAuthToken(user.getEmail(), password);
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
@@ -831,6 +839,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
authorizeService.addPolicy(context, author1, Constants.WRITE, user);
context.restoreAuthSystemState();
String token = getAuthToken(user.getEmail(), password);
MvcResult mvcResult = getClient(getAuthToken(admin.getEmail(), password))
@@ -924,6 +934,7 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
ePersonService.update(context, user);
context.setCurrentUser(user);
context.restoreAuthSystemState();
String token = getAuthToken(admin.getEmail(), password);
@@ -1015,6 +1026,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
authorizeService.addPolicy(context, author1, Constants.WRITE, user);
context.restoreAuthSystemState();
String token = getAuthToken(admin.getEmail(), password);
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
@@ -1113,6 +1126,8 @@ public class RelationshipRestRepositoryIT extends AbstractControllerIntegrationT
String token = getAuthToken(user.getEmail(), password);
context.restoreAuthSystemState();
MvcResult mvcResult = getClient(token).perform(post("/api/core/relationships")
.param("relationshipType",
isAuthorOfPublicationRelationshipType.getID()