@Test void fromRequest() throws NoSuchFieldException { FieldSetter.setField(defaultConsentReferencePolicy, defaultConsentReferencePolicy.getClass().getDeclaredField("hmacSecret"), "6VFX8YFQG5DLFKZIMNLGH9P406XR1SY4"); ConsentReference reference = defaultConsentReferencePolicy.fromURL(REDIRECT_ID, CONSENT_TYPE_AIS, ENCRYPTED_CONSENT_ID); ConsentReference consentReference = defaultConsentReferencePolicy.fromRequest(ENCRYPTED_CONSENT_ID, AUTHORIZATION_ID, reference.getCookieString(), false); assertNotNull(consentReference); assertEquals(AUTHORIZATION_ID, consentReference.getAuthorizationId()); assertEquals(REDIRECT_ID, consentReference.getRedirectId()); assertEquals(CONSENT_TYPE_AIS, consentReference.getConsentType()); assertEquals(ENCRYPTED_CONSENT_ID, consentReference.getEncryptedConsentId()); assertNotNull(consentReference.getCookieString()); }
@Override public ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict) { return verifyParseJWT(encryptedConsentId, authorizationId, cookieString, strict); }
DefaultConsentReferencePolicy implements ConsentReferencePolicy { @Override public ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict) { return verifyParseJWT(encryptedConsentId, authorizationId, cookieString, strict); } }
DefaultConsentReferencePolicy implements ConsentReferencePolicy { @Override public ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict) { return verifyParseJWT(encryptedConsentId, authorizationId, cookieString, strict); }  }
DefaultConsentReferencePolicy implements ConsentReferencePolicy { @Override public ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict) { return verifyParseJWT(encryptedConsentId, authorizationId, cookieString, strict); }  @Override ConsentReference fromURL(String redirectId, ConsentType consentType, String encryptedConsentId); @Override ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict); }
DefaultConsentReferencePolicy implements ConsentReferencePolicy { @Override public ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict) { return verifyParseJWT(encryptedConsentId, authorizationId, cookieString, strict); }  @Override ConsentReference fromURL(String redirectId, ConsentType consentType, String encryptedConsentId); @Override ConsentReference fromRequest(String encryptedConsentId, String authorizationId, String cookieString, boolean strict);  }