@Test public void createSource_withNonLoggingListener_doesNotLogButDoesCreateSource() { try { TestLoggingListener testLoggingListener = new TestLoggingListener(false); Card card = new Card("4242424242424242", 1, 2050, "123"); Source source = StripeApiHandler.createSource( null, RuntimeEnvironment.application.getApplicationContext(), SourceParams.createCardParams(card), FUNCTIONAL_SOURCE_PUBLISHABLE_KEY, null, testLoggingListener); assertNotNull(source); assertNull(testLoggingListener.mStripeException); assertNull(testLoggingListener.mStripeResponse); } catch (AuthenticationException authEx) { fail("Unexpected error: " + authEx.getLocalizedMessage()); } catch (StripeException stripeEx) { fail("Unexpected error when connecting to Stripe API: " + stripeEx.getLocalizedMessage()); } }
@Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return createSource( uidProvider, context, sourceParams, publishableKey, stripeAccount, loggingResponseListener, null); }
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return createSource( uidProvider, context, sourceParams, publishableKey, stripeAccount, loggingResponseListener, null); } }
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return createSource( uidProvider, context, sourceParams, publishableKey, stripeAccount, loggingResponseListener, null); }  }
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return createSource( uidProvider, context, sourceParams, publishableKey, stripeAccount, loggingResponseListener, null); }   }
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return createSource( uidProvider, context, sourceParams, publishableKey, stripeAccount, loggingResponseListener, null); }    }