-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the manager relation between rick and morty in integration tests
- Loading branch information
1 parent
1fe4fd4
commit 08032ef
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ void testGetUserWithNoRelations() { | |
void testGetUserWithRelations() { | ||
// Arrange | ||
Object managerObject = Directory.buildObject("user", "[email protected]"); | ||
Relation managerRelation = Directory.buildRelation("user", "morty@the-citadel.com", "manager", "user", "rick@the-citadel.com"); | ||
Relation managerRelation = Directory.buildRelation("user", "rick@the-citadel.com", "manager", "user", "morty@the-citadel.com"); | ||
Relation adminRelation = Directory.buildRelation("group", "admin", "member", "user", "[email protected]"); | ||
|
||
// Act | ||
|
@@ -169,15 +169,15 @@ void testGetUserManyRequest() { | |
@Test | ||
void testGetRelation() { | ||
// Arrange | ||
Relation expectedRelation = Directory.buildRelation("user", "morty@the-citadel.com", "manager", "user", "rick@the-citadel.com"); | ||
Relation expectedRelation = Directory.buildRelation("user", "rick@the-citadel.com", "manager", "user", "morty@the-citadel.com"); | ||
|
||
// Act | ||
GetRelationResponse getRelationResponse = directoryClient.getRelation( | ||
"user", | ||
"morty@the-citadel.com", | ||
"rick@the-citadel.com", | ||
"manager", | ||
"user", | ||
"rick@the-citadel.com"); | ||
"morty@the-citadel.com"); | ||
|
||
// Assert | ||
Relation relation = getRelationResponse.getResult(); | ||
|
@@ -190,15 +190,15 @@ void testGetRelation() { | |
@Test | ||
void testGetRelations() { | ||
// Arrange | ||
Relation expectedManagerRelation = Directory.buildRelation("user", "morty@the-citadel.com", "manager", "user", "rick@the-citadel.com"); | ||
Relation expectedFriendRelation = Directory.buildRelation("user", "morty@the-citadel.com", "friend", "user", "rick@the-citadel.com"); | ||
Relation expectedManagerRelation = Directory.buildRelation("user", "rick@the-citadel.com", "manager", "user", "morty@the-citadel.com"); | ||
Relation expectedFriendRelation = Directory.buildRelation("user", "rick@the-citadel.com", "friend", "user", "morty@the-citadel.com"); | ||
|
||
directoryClient.setRelation( | ||
"user", | ||
"morty@the-citadel.com", | ||
"rick@the-citadel.com", | ||
"friend", | ||
"user", | ||
"rick@the-citadel.com"); | ||
"morty@the-citadel.com"); | ||
|
||
GetRelationsRequest getRelationsRequest = GetRelationsRequest.newBuilder().setObjectType("user").build(); | ||
|
||
|
@@ -217,10 +217,10 @@ void testCheckRelationManager() { | |
// Arrange & Act | ||
CheckRelationResponse checkRelationResponse = directoryClient.checkRelation( | ||
"user", | ||
"morty@the-citadel.com", | ||
"rick@the-citadel.com", | ||
"manager", | ||
"user", | ||
"rick@the-citadel.com"); | ||
"morty@the-citadel.com"); | ||
|
||
// Assert | ||
assertTrue(checkRelationResponse.getCheck()); | ||
|
@@ -231,10 +231,10 @@ void testCheckRelationFriend() { | |
// Arrange & Act | ||
CheckRelationResponse checkRelationResponse = directoryClient.checkRelation( | ||
"user", | ||
"morty@the-citadel.com", | ||
"rick@the-citadel.com", | ||
"friend", | ||
"user", | ||
"rick@the-citadel.com"); | ||
"morty@the-citadel.com"); | ||
|
||
// Assert | ||
assertFalse(checkRelationResponse.getCheck()); | ||
|
@@ -245,10 +245,10 @@ void testCheckManager() { | |
// Arrange & Act | ||
CheckResponse checkResponse = directoryClient.check( | ||
"user", | ||
"morty@the-citadel.com", | ||
"rick@the-citadel.com", | ||
"manager", | ||
"user", | ||
"rick@the-citadel.com"); | ||
"morty@the-citadel.com"); | ||
|
||
// Assert | ||
assertTrue(checkResponse.getCheck()); | ||
|
@@ -259,18 +259,18 @@ void testGetGraph() { | |
// Arrange | ||
GetGraphRequest getGraphRequest = GetGraphRequest.newBuilder() | ||
.setAnchorType("user") | ||
.setAnchorId("morty@the-citadel.com") | ||
.setAnchorId("rick@the-citadel.com") | ||
.setObjectType("user") | ||
.setObjectId("morty@the-citadel.com") | ||
.setObjectId("rick@the-citadel.com") | ||
.build(); | ||
|
||
List<ObjectDependency> objectDependencyList = Arrays.asList( | ||
ObjectDependency.newBuilder() | ||
.setObjectType("user") | ||
.setObjectId("morty@the-citadel.com") | ||
.setObjectId("rick@the-citadel.com") | ||
.setRelation("manager") | ||
.setSubjectType("user") | ||
.setSubjectId("rick@the-citadel.com") | ||
.setSubjectId("morty@the-citadel.com") | ||
.build() | ||
); | ||
|
||
|
@@ -426,7 +426,7 @@ private List<ImportElement> importCitadelDataList() { | |
Object editorGroup = Directory.buildObject("group", "editor"); | ||
Relation rickAdminRelation = Directory.buildRelation("group", "admin", "member", "user", "[email protected]"); | ||
Relation mortyEditorRelation = Directory.buildRelation("group", "editor", "member", "user", "[email protected]"); | ||
Relation managerRelation = Directory.buildRelation("user", "morty@the-citadel.com", "manager", "user", "rick@the-citadel.com"); | ||
Relation managerRelation = Directory.buildRelation("user", "rick@the-citadel.com", "manager", "user", "morty@the-citadel.com"); | ||
|
||
importElements.add(new ImportElement(rick)); | ||
importElements.add(new ImportElement(morty)); | ||
|