commentary!
parent
d0eb98b8ff
commit
de77f2c75a
|
@ -12,6 +12,10 @@ import com.nimbusds.jose.JWSAlgorithm;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
* These tests make sure that the algorithm name processing
|
||||||
|
* is functional on the three embedded JOSE classes.
|
||||||
|
*
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,6 +26,9 @@ public class RegisteredClientTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testRegisteredClient() {
|
public void testRegisteredClient() {
|
||||||
|
|
||||||
|
// make sure all the pass-through getters and setters work
|
||||||
|
|
||||||
RegisteredClient c = new RegisteredClient();
|
RegisteredClient c = new RegisteredClient();
|
||||||
|
|
||||||
c.setClientId("s6BhdRkqt3");
|
c.setClientId("s6BhdRkqt3");
|
||||||
|
@ -87,11 +90,13 @@ public class RegisteredClientTest {
|
||||||
c.setContacts(ImmutableSet.of("ve7jtb@example.org", "mary@example.org"));
|
c.setContacts(ImmutableSet.of("ve7jtb@example.org", "mary@example.org"));
|
||||||
c.setRequestUris(ImmutableSet.of("https://client.example.org/rf.txt#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"));
|
c.setRequestUris(ImmutableSet.of("https://client.example.org/rf.txt#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"));
|
||||||
|
|
||||||
|
// Create a RegisteredClient based on a ClientDetailsEntity object and set several properties
|
||||||
RegisteredClient rc = new RegisteredClient(c);
|
RegisteredClient rc = new RegisteredClient(c);
|
||||||
rc.setClientSecretExpiresAt(new Date(1577858400L * 1000L));
|
rc.setClientSecretExpiresAt(new Date(1577858400L * 1000L));
|
||||||
rc.setRegistrationAccessToken("this.is.an.access.token.value.ffx83");
|
rc.setRegistrationAccessToken("this.is.an.access.token.value.ffx83");
|
||||||
rc.setRegistrationClientUri("https://server.example.com/connect/register?client_id=s6BhdRkqt3");
|
rc.setRegistrationClientUri("https://server.example.com/connect/register?client_id=s6BhdRkqt3");
|
||||||
|
|
||||||
|
// make sure all the pass-throughs work
|
||||||
assertEquals("s6BhdRkqt3", rc.getClientId());
|
assertEquals("s6BhdRkqt3", rc.getClientId());
|
||||||
assertEquals("ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", rc.getClientSecret());
|
assertEquals("ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", rc.getClientSecret());
|
||||||
assertEquals(new Date(1577858400L * 1000L), rc.getClientSecretExpiresAt());
|
assertEquals(new Date(1577858400L * 1000L), rc.getClientSecretExpiresAt());
|
||||||
|
@ -133,8 +138,10 @@ public class RegisteredClientTest {
|
||||||
c.setContacts(ImmutableSet.of("ve7jtb@example.org", "mary@example.org"));
|
c.setContacts(ImmutableSet.of("ve7jtb@example.org", "mary@example.org"));
|
||||||
c.setRequestUris(ImmutableSet.of("https://client.example.org/rf.txt#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"));
|
c.setRequestUris(ImmutableSet.of("https://client.example.org/rf.txt#qpXaRLh_n93TTR9F252ValdatUQvQiJi5BDub2BeznA"));
|
||||||
|
|
||||||
|
// Create a RegisteredClient based on a ClientDetails, a token, and a server URI
|
||||||
RegisteredClient rc = new RegisteredClient(c, "this.is.an.access.token.value.ffx83", "https://server.example.com/connect/register?client_id=s6BhdRkqt3");
|
RegisteredClient rc = new RegisteredClient(c, "this.is.an.access.token.value.ffx83", "https://server.example.com/connect/register?client_id=s6BhdRkqt3");
|
||||||
|
|
||||||
|
// make sure all the pass-throughs work
|
||||||
assertEquals("s6BhdRkqt3", rc.getClientId());
|
assertEquals("s6BhdRkqt3", rc.getClientId());
|
||||||
assertEquals("ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", rc.getClientSecret());
|
assertEquals("ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", rc.getClientSecret());
|
||||||
assertEquals("this.is.an.access.token.value.ffx83", rc.getRegistrationAccessToken());
|
assertEquals("this.is.an.access.token.value.ffx83", rc.getRegistrationAccessToken());
|
||||||
|
|
Loading…
Reference in New Issue