Search in sources :

Example 6 with StripeResponse

use of com.stripe.net.StripeResponse in project stripe-java by stripe.

the class StripeResponseTest method testHeaders.

@Test
public void testHeaders() {
    Map<String, List<String>> headerMap = generateHeaderMap();
    StripeResponse stripeResponse = new StripeResponse(200, chargeBody, headerMap);
    assertThat(stripeResponse.headers(), instanceOf(StripeHeaders.class));
}
Also used : StripeHeaders(com.stripe.net.StripeHeaders) ArrayList(java.util.ArrayList) List(java.util.List) StripeResponse(com.stripe.net.StripeResponse) BaseStripeTest(com.stripe.BaseStripeTest) Test(org.junit.Test)

Example 7 with StripeResponse

use of com.stripe.net.StripeResponse in project stripe-java by stripe.

the class StripeResponseTest method testBody.

@Test
public void testBody() {
    StripeResponse stripeResponse = new StripeResponse(200, chargeBody);
    assertEquals(200, stripeResponse.code());
    assertEquals(chargeBody, stripeResponse.body());
}
Also used : StripeResponse(com.stripe.net.StripeResponse) BaseStripeTest(com.stripe.BaseStripeTest) Test(org.junit.Test)

Example 8 with StripeResponse

use of com.stripe.net.StripeResponse in project stripe-java by stripe.

the class StripeResponseTest method testCode.

@Test
public void testCode() {
    StripeResponse stripeResponse = new StripeResponse(200, chargeBody);
    assertEquals(200, stripeResponse.code());
    stripeResponse = new StripeResponse(201, chargeBody);
    assertEquals(201, stripeResponse.code());
}
Also used : StripeResponse(com.stripe.net.StripeResponse) BaseStripeTest(com.stripe.BaseStripeTest) Test(org.junit.Test)

Aggregations

StripeResponse (com.stripe.net.StripeResponse)8 Test (org.junit.Test)8 BaseStripeTest (com.stripe.BaseStripeTest)6 ArrayList (java.util.ArrayList)3 List (java.util.List)3 BaseStripeFunctionalTest (com.stripe.BaseStripeFunctionalTest)2 Customer (com.stripe.model.Customer)1 CustomerCollection (com.stripe.model.CustomerCollection)1 RequestOptions (com.stripe.net.RequestOptions)1 StripeHeaders (com.stripe.net.StripeHeaders)1