-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 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 |
---|---|---|
|
@@ -263,10 +263,7 @@ public ResponseEntity<Void> deleteRole(@PathVariable("id") Long id, | |
"intendedAuthority": "INVITER", | ||
"message": "Personal message included in the email", | ||
"language": "en", | ||
"enforceEmailEquality": false, | ||
"eduIDOnly": false, | ||
"guestRoleIncluded": true, | ||
"suppressSendingEmails": false, | ||
"invites": [ | ||
"[email protected]" | ||
], | ||
|
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
27 changes: 27 additions & 0 deletions
27
server/src/test/java/access/provision/scim/GroupURNTest.java
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package access.provision.scim; | ||
|
||
import access.model.Role; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.UUID; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class GroupURNTest { | ||
|
||
@Test | ||
void sanitizeRoleShortName() { | ||
assertEquals("expected_short_name_yep", | ||
GroupURN.sanitizeRoleShortName("expected SHORT name &&^*&%&^* yep")); | ||
} | ||
|
||
@Test | ||
void urnFromRole() { | ||
String identifier = UUID.randomUUID().toString(); | ||
Role role = new Role(); | ||
role.setShortName(GroupURN.sanitizeRoleShortName("expected SHORT name &&^*&%&^* yep")); | ||
role.setIdentifier(identifier); | ||
String urn = GroupURN.urnFromRole("prefix", role); | ||
assertEquals(String.format("prefix:%s:expected_short_name_yep", identifier), urn); | ||
} | ||
} |