@Test
public void testShouldFailWithSignatureAndKeyIdNoAmpersand() throws Exception {

  RewardedAdsVerifier verifier =
      new RewardedAdsVerifier.Builder()
          .setVerifyingPublicKeys(GOOGLE_VERIFYING_PUBLIC_KEYS_JSON)
          .build();
  try {
    verifier.verify(
        new StringBuilder(REWARD_URL)
            .append("&")
            .append(RewardedAdsVerifier.SIGNATURE_PARAM_NAME)
            .append("foo")
            .append(RewardedAdsVerifier.KEY_ID_PARAM_NAME)
            .append("123")
            .toString());
  } catch (GeneralSecurityException e) {
    assertEquals("signature and key id must be the last two query parameters", e.getMessage());
  }
}