throws Exception {
JWTClaimsSet claimsSet = new JWTClaimsSet();
claimsSet.setIssuer("https://c2id.com");
SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet);
jwt.sign(new MACSigner("abcdef1234567890"));
OIDCClientMetadata metadata = new OIDCClientMetadata();
metadata.setRedirectionURI(new URI("https://client.com/in"));
metadata.setName("Test App");
OIDCClientRegistrationRequest request = new OIDCClientRegistrationRequest(new URI("https://c2id.com/reg"), metadata, jwt, null);
assertEquals(metadata, request.getClientMetadata());
assertEquals(jwt, request.getSoftwareStatement());
assertNull(request.getAccessToken());
HTTPRequest httpRequest = request.toHTTPRequest();
request = OIDCClientRegistrationRequest.parse(httpRequest);
assertEquals("https://client.com/in", request.getClientMetadata().getRedirectionURIs().iterator().next().toString());
assertEquals("Test App", request.getClientMetadata().getName());
assertEquals(jwt.serialize(), request.getSoftwareStatement().getParsedString());
assertTrue(request.getSoftwareStatement().verify(new MACVerifier("abcdef1234567890")));
}