@Test
public void testShouldVerifyWithEncodedUrl() throws Exception {

  RewardedAdsVerifier verifier =
      new RewardedAdsVerifier.Builder()
          .setVerifyingPublicKeys(GOOGLE_VERIFYING_PUBLIC_KEYS_JSON)
          .build();
  String rewardUrl = "https://publisher.com/path?foo=hello%20world&bar=user%40gmail.com";
  String decodedQueryString = "foo=hello world&bar=user@gmail.com";
  EcdsaSignJce signer =
      new EcdsaSignJce(
          EllipticCurves.getEcPrivateKey(Base64.decode(GOOGLE_SIGNING_PRIVATE_KEY_PKCS8_BASE64)),
          HashType.SHA256,
          EcdsaEncoding.DER);
  byte[] signature = signer.sign(decodedQueryString.getBytes(UTF_8));
  String signedUrl = buildUrl(rewardUrl, signature, KEY_ID);
  verifier.verify(signedUrl);
}