forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#44936 from sberyozkin/mutable_oidc_reque…
…st_context_props Make sure OidcRequestContextProperties are always modifiable
- Loading branch information
Showing
3 changed files
with
34 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
31 changes: 31 additions & 0 deletions
31
...untime/src/test/java/io/quarkus/oidc/common/runtime/OidcRequestContextPropertiesTest.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,31 @@ | ||
package io.quarkus.oidc.common.runtime; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
import java.util.Map; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.oidc.common.OidcRequestContextProperties; | ||
|
||
public class OidcRequestContextPropertiesTest { | ||
|
||
@Test | ||
public void testModifyPropertiesDefaultConstructor() throws Exception { | ||
OidcRequestContextProperties props = new OidcRequestContextProperties(); | ||
assertNull(props.get("a")); | ||
props.put("a", "value"); | ||
assertEquals("value", props.get("a")); | ||
} | ||
|
||
@Test | ||
public void testModifyExistinProperties() throws Exception { | ||
OidcRequestContextProperties props = new OidcRequestContextProperties(Map.of("a", "value")); | ||
assertEquals("value", props.get("a")); | ||
props.put("a", "avalue"); | ||
assertEquals("avalue", props.get("a")); | ||
props.put("b", "bvalue"); | ||
assertEquals("bvalue", props.get("b")); | ||
} | ||
} |
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