@Test public void shouldLaunchPurchaseAndStartIntentAndThenHandleActivityResultWithInvalidData() throws Exception {

    shouldStartIntentAfterSuccessfulLaunchPurchase();
    Intent data = new Intent();
    data.putExtra(RESPONSE_CODE, OK.code);
    data.putExtra(RESPONSE_INAPP_PURCHASE_DATA, "this is not json");
    data.putExtra(RESPONSE_INAPP_SIGNATURE, "");
    assertThat(helper.handleActivityResult(TEST_REQUEST_CODE, Activity.RESULT_OK, data)).isTrue();
    verify(purchaseFinishedListener).onIabPurchaseFinished(new IabResult(IABHELPER_BAD_RESPONSE, "Failed to parse purchase data."), null);
}