-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELY-2797] check for null Boolean and return boolean
- Loading branch information
Showing
2 changed files
with
67 additions
and
6 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
61 changes: 61 additions & 0 deletions
61
http/oidc/src/test/java/org/wildfly/security/http/oidc/OidcProviderMetadataTest.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,61 @@ | ||
package org.wildfly.security.http.oidc; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* Test OIDC json config class properly returns boolean values. | ||
*/ | ||
public class OidcProviderMetadataTest { | ||
private OidcProviderMetadata oidcSecRealm; | ||
|
||
@Before | ||
public void setUp() { | ||
oidcSecRealm = new OidcProviderMetadata(); | ||
} | ||
|
||
@Test | ||
public void testClaimsParameterSupported() throws Exception { | ||
assertFalse(oidcSecRealm.getClaimsParameterSupported()); | ||
oidcSecRealm.setClaimsParameterSupported(true); | ||
assertTrue(oidcSecRealm.getClaimsParameterSupported()); | ||
} | ||
|
||
@Test | ||
public void testRequestParameterSupported() throws Exception { | ||
assertFalse(oidcSecRealm.getRequestParameterSupported()); | ||
oidcSecRealm.setRequestParameterSupported(true); | ||
assertTrue(oidcSecRealm.getRequestParameterSupported()); | ||
} | ||
|
||
@Test | ||
public void testRequestUriParameterSupported() throws Exception { | ||
assertFalse(oidcSecRealm.getRequestUriParameterSupported()); | ||
oidcSecRealm.setRequestUriParameterSupported(true); | ||
assertTrue(oidcSecRealm.getRequestUriParameterSupported()); | ||
} | ||
|
||
@Test | ||
public void testBackchannelLogoutSupported() throws Exception { | ||
assertFalse(oidcSecRealm.getBackchannelLogoutSupported()); | ||
oidcSecRealm.setBackchannelLogoutSupported(true); | ||
assertTrue(oidcSecRealm.getBackchannelLogoutSupported()); | ||
} | ||
|
||
@Test | ||
public void testBackchannelLogoutSessionSupported() throws Exception { | ||
assertFalse(oidcSecRealm.getBackchannelLogoutSessionSupported()); | ||
oidcSecRealm.setBackchannelLogoutSessionSupported(true); | ||
assertTrue(oidcSecRealm.getBackchannelLogoutSessionSupported()); | ||
} | ||
|
||
@Test | ||
public void testTlsClientCertificateBoundAccessTokens() throws Exception { | ||
assertFalse(oidcSecRealm.getTlsClientCertificateBoundAccessTokens()); | ||
oidcSecRealm.setTlsClientCertificateBoundAccessTokens(true); | ||
assertTrue(oidcSecRealm.getTlsClientCertificateBoundAccessTokens()); | ||
} | ||
} |