This repository has been archived by the owner on May 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset state for client authorization request
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 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
21 changes: 21 additions & 0 deletions
21
...test/java/org/springframework/security/oauth2/client/DefaultOAuth2ClientContextTests.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,21 @@ | ||
package org.springframework.security.oauth2.client; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNull; | ||
|
||
public class DefaultOAuth2ClientContextTests { | ||
|
||
@Test | ||
public void resetsState() { | ||
DefaultOAuth2ClientContext clientContext = new DefaultOAuth2ClientContext(); | ||
clientContext.setPreservedState("state1", "some-state-1"); | ||
clientContext.setPreservedState("state2", "some-state-2"); | ||
clientContext.setPreservedState("state3", "some-state-3"); | ||
assertNull(clientContext.removePreservedState("state1")); | ||
assertNull(clientContext.removePreservedState("state2")); | ||
assertEquals("some-state-3", clientContext.removePreservedState("state3")); | ||
} | ||
|
||
} |