7
7
import com .google .gson .Gson ;
8
8
import com .google .gson .reflect .TypeToken ;
9
9
import com .stripe .exception .StripeException ;
10
- import com .stripe .model .StripeObjectInterface ;
10
+ import com .stripe .model .StripeObject ;
11
11
import com .stripe .net .*;
12
12
import java .io .BufferedReader ;
13
13
import java .io .ByteArrayOutputStream ;
@@ -173,7 +173,7 @@ public static <T> void verifyRequest(
173
173
verifyRequest (method , path , params , null );
174
174
}
175
175
176
- public static <T extends StripeObjectInterface > void verifyRequest (
176
+ public static <T extends StripeObject > void verifyRequest (
177
177
ApiResource .RequestMethod method ,
178
178
String path ,
179
179
Map <String , Object > params ,
@@ -190,7 +190,7 @@ public static <T extends StripeObjectInterface> void verifyRequest(
190
190
* @param options request options. If null, the options are not checked.
191
191
*/
192
192
@ SuppressWarnings ("AssertionFailureIgnored" )
193
- public static <T extends StripeObjectInterface > void verifyRequest (
193
+ public static <T extends StripeObject > void verifyRequest (
194
194
BaseAddress baseAddress ,
195
195
ApiResource .RequestMethod method ,
196
196
String path ,
@@ -216,8 +216,8 @@ public static <T extends StripeObjectInterface> void verifyRequest(
216
216
}
217
217
218
218
@ SuppressWarnings ("AssertionFailureIgnored" )
219
- public static <T extends StripeObjectInterface > void verifyRequest (
220
- Consumer < ApiRequest > assertOnApiRequest ) throws StripeException {
219
+ public static <T extends StripeObject > void verifyRequest (Consumer < ApiRequest > assertOnApiRequest )
220
+ throws StripeException {
221
221
222
222
ArgumentCaptor <ApiRequest > requestCaptor = ArgumentCaptor .forClass (ApiRequest .class );
223
223
List <AssertionError > exceptions = new ArrayList <AssertionError >();
@@ -249,7 +249,7 @@ public static <T extends StripeObjectInterface> void verifyRequest(
249
249
}
250
250
251
251
@ SuppressWarnings ("AssertionFailureIgnored" )
252
- public static <T extends StripeObjectInterface > void verifyStripeRequest (
252
+ public static <T extends StripeObject > void verifyStripeRequest (
253
253
Consumer <StripeRequest > assertOnStripeRequest ) throws StripeException {
254
254
255
255
ArgumentCaptor <StripeRequest > requestCaptor = ArgumentCaptor .forClass (StripeRequest .class );
@@ -292,7 +292,7 @@ public static <T> void verifyNoMoreRequests() {
292
292
* @see BaseStripeTest#stubRequest(ApiResource.RequestMethod, String, Map, RequestOptions, Class,
293
293
* String)
294
294
*/
295
- public static <T extends StripeObjectInterface > void stubRequest (
295
+ public static <T extends StripeObject > void stubRequest (
296
296
ApiResource .RequestMethod method , String path , Type typeToken , String response )
297
297
throws StripeException {
298
298
stubRequest (BaseAddress .API , method , path , null , null , typeToken , response );
@@ -304,7 +304,7 @@ public static <T extends StripeObjectInterface> void stubRequest(
304
304
* @see BaseStripeTest#stubRequest(ApiResource.RequestMethod, String, Map, RequestOptions, Class,
305
305
* String)
306
306
*/
307
- public static <T extends StripeObjectInterface > void stubRequest (
307
+ public static <T extends StripeObject > void stubRequest (
308
308
ApiResource .RequestMethod method ,
309
309
String path ,
310
310
Map <String , Object > params ,
@@ -325,7 +325,7 @@ public static <T extends StripeObjectInterface> void stubRequest(
325
325
* @param typeToken Class of the API resource that will be returned for the stubbed request.
326
326
* @param response JSON payload of the API resource that will be returned for the stubbed request.
327
327
*/
328
- public static <T extends StripeObjectInterface > void stubRequest (
328
+ public static <T extends StripeObject > void stubRequest (
329
329
BaseAddress baseAddress ,
330
330
ApiResource .RequestMethod method ,
331
331
String path ,
@@ -361,7 +361,7 @@ public static <T extends StripeObjectInterface> void stubRequest(
361
361
* @param typeToken Class of the API resource that will be returned for the stubbed request.
362
362
* @param response JSON payload of the API resource that will be returned for the stubbed request.
363
363
*/
364
- public static <T extends StripeObjectInterface > void stubRequestReturnError (
364
+ public static <T extends StripeObject > void stubRequestReturnError (
365
365
BaseAddress baseAddress ,
366
366
ApiResource .RequestMethod method ,
367
367
String path ,
@@ -380,8 +380,8 @@ public static <T extends StripeObjectInterface> void stubRequestReturnError(
380
380
}
381
381
382
382
/** Stubs an OAuth API request. stripe-mock does not supported OAuth endpoints at this time. */
383
- public static <T extends StripeObjectInterface > void stubOAuthRequest (
384
- Class < T > clazz , String response ) throws StripeException {
383
+ public static <T extends StripeObject > void stubOAuthRequest (Class < T > clazz , String response )
384
+ throws StripeException {
385
385
Mockito .doReturn (ApiResource .GSON .fromJson (response , clazz ))
386
386
.when (networkSpy )
387
387
.request (Mockito .any (ApiRequest .class ), Mockito .<Type >any ());
0 commit comments