@Test public void shouldHandleInvalidSignature() throws Exception {

    shouldStartIntentAfterSuccessfulLaunchPurchase();
    Intent data = new Intent();
    data.putExtra(RESPONSE_CODE, OK.code);
    String purchaseData = "{ \"productId\": \"foo\" }";
    data.putExtra(RESPONSE_INAPP_PURCHASE_DATA, purchaseData);
    data.putExtra(RESPONSE_INAPP_SIGNATURE, "some signature");
    when(signatureValidator.validate(eq(purchaseData), eq("some signature"))).thenReturn(false);
    assertThat(helper.handleActivityResult(TEST_REQUEST_CODE, Activity.RESULT_OK, data)).isTrue();
    verify(purchaseFinishedListener).onIabPurchaseFinished(
            eq(new IabResult(IABHELPER_VERIFICATION_FAILED)), any(Purchase.class));
}