Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 69 additions & 2 deletions src/test/java/com/stripe/functional/GeneratedExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -12807,6 +12807,73 @@ public void testPromotionCodesGet2ServicesNonNamespaced() throws StripeException

@Test
public void testPromotionCodesPost() throws StripeException {
PromotionCodeCreateParams params =
PromotionCodeCreateParams.builder()
.setPromotion(
PromotionCodeCreateParams.Promotion.builder()
.setType(PromotionCodeCreateParams.Promotion.Type.COUPON)
.setCoupon("Z4OV52SU")
.build())
.build();

PromotionCode promotionCode = PromotionCode.create(params);
assertNotNull(promotionCode);
verifyRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
"/v1/promotion_codes",
params.toMap(),
null);
}

@Test
public void testPromotionCodesPostServices() throws StripeException {
StripeClient client = new StripeClient(networkSpy);

com.stripe.param.PromotionCodeCreateParams params =
com.stripe.param.PromotionCodeCreateParams.builder()
.setPromotion(
com.stripe.param.PromotionCodeCreateParams.Promotion.builder()
.setType(com.stripe.param.PromotionCodeCreateParams.Promotion.Type.COUPON)
.setCoupon("Z4OV52SU")
.build())
.build();

com.stripe.model.PromotionCode promotionCode = client.v1().promotionCodes().create(params);
assertNotNull(promotionCode);
verifyRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
"/v1/promotion_codes",
params.toMap(),
null);
}

@Test
public void testPromotionCodesPostServicesNonNamespaced() throws StripeException {
StripeClient client = new StripeClient(networkSpy);

com.stripe.param.PromotionCodeCreateParams params =
com.stripe.param.PromotionCodeCreateParams.builder()
.setPromotion(
com.stripe.param.PromotionCodeCreateParams.Promotion.builder()
.setType(com.stripe.param.PromotionCodeCreateParams.Promotion.Type.COUPON)
.setCoupon("Z4OV52SU")
.build())
.build();

com.stripe.model.PromotionCode promotionCode = client.promotionCodes().create(params);
assertNotNull(promotionCode);
verifyRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
"/v1/promotion_codes",
params.toMap(),
null);
}

@Test
public void testPromotionCodesPost2() throws StripeException {
PromotionCode resource = PromotionCode.retrieve("promo_xxxxxxxxxxxxx");

PromotionCodeUpdateParams params =
Expand All @@ -12823,7 +12890,7 @@ public void testPromotionCodesPost() throws StripeException {
}

@Test
public void testPromotionCodesPostServices() throws StripeException {
public void testPromotionCodesPost2Services() throws StripeException {
StripeClient client = new StripeClient(networkSpy);

com.stripe.param.PromotionCodeUpdateParams params =
Expand All @@ -12843,7 +12910,7 @@ public void testPromotionCodesPostServices() throws StripeException {
}

@Test
public void testPromotionCodesPostServicesNonNamespaced() throws StripeException {
public void testPromotionCodesPost2ServicesNonNamespaced() throws StripeException {
StripeClient client = new StripeClient(networkSpy);

com.stripe.param.PromotionCodeUpdateParams params =
Expand Down
72 changes: 0 additions & 72 deletions src/test/java/com/stripe/functional/PromotionCodeTest.java

This file was deleted.