ClientID id = new ClientID("123");
Date issueDate = new Date(new Date().getTime() / 1000 * 1000);
OIDCClientMetadata metadata = new OIDCClientMetadata();
metadata.setRedirectionURI(new URI("https://client.com/cb"));
metadata.applyDefaults();
Secret secret = new Secret();
BearerAccessToken accessToken = new BearerAccessToken();
URI uri = new URI("https://c2id.com/client-reg/123");
OIDCClientInformation info = new OIDCClientInformation(
id, issueDate, metadata, secret, uri, accessToken);
OIDCClientInformationResponse response = new OIDCClientInformationResponse(info);
assertEquals(info, response.getOIDCClientInformation());
assertEquals(info, response.getClientInformation());
HTTPResponse httpResponse = response.toHTTPResponse();
response = OIDCClientInformationResponse.parse(httpResponse);
assertEquals(id.getValue(), response.getClientInformation().getID().getValue());
assertEquals(issueDate, response.getClientInformation().getIDIssueDate());
assertEquals("https://client.com/cb", response.getClientInformation().getMetadata().getRedirectionURIs().iterator().next().toString());
assertEquals(secret.getValue(), response.getClientInformation().getSecret().getValue());
assertEquals(uri.toString(), response.getClientInformation().getRegistrationURI().toString());
assertEquals(accessToken.getValue(), response.getClientInformation().getRegistrationAccessToken().getValue());
}