-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
8d68cfb
commit 7ea84b3
Showing
5 changed files
with
56 additions
and
13 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
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
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
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
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 |
---|---|---|
|
@@ -5,18 +5,41 @@ | |
|
||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
|
||
import org.eclipse.pass.main.SamlIntegrationTest; | ||
import org.eclipse.pass.object.PassClient; | ||
import org.eclipse.pass.object.model.User; | ||
import org.eclipse.pass.object.model.UserRole; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
public class PassAuthenticationFilterTest extends SamlIntegrationTest { | ||
@Autowired | ||
private PassAuthenticationFilter passAuthFilter; | ||
|
||
@Test | ||
public void testLoggedInUser() throws IOException { | ||
User submitter = doSamlLogin(); | ||
|
||
User expected = new User(); | ||
|
||
expected.setDisplayName("Sally M. Submitter"); | ||
expected.setEmail("[email protected]"); | ||
expected.setAffiliation(new HashSet<>(List.of("[email protected]", "johnshopkins.edu"))); | ||
expected.setFirstName("Sally"); | ||
expected.setLastName("Submitter"); | ||
expected.setLocatorIds(List.of("johnshopkins.edu:unique-id:sms123456789", | ||
"johnshopkins.edu:eppn:sallysubmitter123456789", | ||
"johnshopkins.edu:employeeid:123456789")); | ||
expected.setRoles(List.of(UserRole.SUBMITTER)); | ||
expected.setUsername("[email protected]"); | ||
expected.setId(submitter.getId()); | ||
|
||
assertEquals(expected, submitter); | ||
} | ||
|
||
@Test | ||
public void testLoginUpdatesUser() throws IOException { | ||
// Login and get the user. Then update the user. | ||
|