Skip to content

Commit 89e599c

Browse files
Merge upstream and update generated code for v1441
2 parents a48a408 + 82934cf commit 89e599c

File tree

6 files changed

+100
-30
lines changed

6 files changed

+100
-30
lines changed

.github/workflows/ci.yml

+7-12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525

2626
steps:
27+
- uses: extractions/setup-just@v2
2728
- uses: actions/checkout@master
2829

2930
- name: Setup Java
@@ -37,7 +38,7 @@ jobs:
3738
run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV
3839

3940
- name: Spotless
40-
run: ./gradlew spotlessCheck
41+
run: just format-check
4142

4243
- name: Build artifacts
4344
run: ./gradlew assemble javadoc
@@ -59,6 +60,7 @@ jobs:
5960
- "20"
6061

6162
steps:
63+
- uses: extractions/setup-just@v2
6264
- uses: actions/checkout@master
6365

6466
- name: Setup Test Java Runtime
@@ -88,20 +90,13 @@ jobs:
8890
8991
- uses: stripe/openapi/actions/stripe-mock@master
9092
- name: Run test suite
91-
run: make ci-test
92-
93-
- name: Send code coverage report to coveralls.io
94-
run: ./gradlew jacocoTestReport coveralls
95-
if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
96-
env:
97-
CI_NAME: github-actions
98-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
93+
run: just test
9994

10095
publish:
10196
if: >-
102-
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
103-
startsWith(github.ref, 'refs/tags/v') &&
104-
endsWith(github.actor, '-stripe')
97+
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
98+
startsWith(github.ref, 'refs/tags/v') &&
99+
endsWith(github.actor, '-stripe')
105100
needs: [build, test]
106101
runs-on: ubuntu-latest
107102
steps:

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.
2+
13
.PHONY: update-version codegen-format
24
update-version:
35
@echo "$(VERSION)" > VERSION

README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Maven Central](https://img.shields.io/badge/maven--central-v28.3.0-beta.1-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java)
44
[![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java)
55
[![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster)
6-
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master)
76

87
The official [Stripe][stripe] Java client library.
98

@@ -308,6 +307,8 @@ go get -u github.com/stripe/stripe-mock
308307
stripe-mock
309308
```
310309

310+
We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.
311+
311312
To run all checks (tests and code formatting):
312313

313314
```sh
@@ -317,16 +318,20 @@ To run all checks (tests and code formatting):
317318
To run the tests:
318319

319320
```sh
320-
./gradlew test
321+
just test
322+
# or: ./gradlew test
321323
```
322324

323325
You can run particular tests by passing `--tests Class#method`. Make sure you
324326
use the fully qualified class name. For example:
325327

326328
```sh
327-
./gradlew test --tests com.stripe.model.AccountTest
328-
./gradlew test --tests com.stripe.functional.CustomerTest
329-
./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
329+
just test-one com.stripe.model.AccountTest
330+
just test-one com.stripe.functional.CustomerTest
331+
just test-one com.stripe.functional.CustomerTest.testCustomerCreate
332+
# or: ./gradlew test --tests com.stripe.model.AccountTest
333+
# or: ./gradlew test --tests com.stripe.functional.CustomerTest
334+
# or: ./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
330335
```
331336

332337
The library uses [Spotless][spotless] along with
@@ -335,7 +340,8 @@ formatted before PRs are submitted, otherwise CI will fail. Run the formatter
335340
with:
336341

337342
```sh
338-
./gradlew spotlessApply
343+
just format
344+
# or: ./gradlew spotlessApply
339345
```
340346

341347
The library uses [Project Lombok][lombok]. While it is not a requirement, you

build.gradle

-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ plugins {
1515
id "io.freefair.lombok" version "6.3.0"
1616
id "com.diffplug.spotless" version "6.4.0"
1717
id "net.ltgt.errorprone" version "2.0.2"
18-
id "com.github.kt3k.coveralls" version "2.12.0"
1918
id "biz.aQute.bnd.builder" version "6.1.0"
2019
id "org.ajoberstar.git-publish" version "3.0.1"
2120
}
@@ -137,17 +136,6 @@ spotless {
137136
}
138137
}
139138

140-
jacocoTestReport {
141-
reports {
142-
xml.required = true // coveralls plugin depends on xml format report
143-
html.required = true
144-
}
145-
}
146-
147-
coveralls {
148-
jacocoReportPath "build/reports/jacoco/test/jacocoTestReport.xml"
149-
}
150-
151139
gitPublish {
152140
repoUri = 'https://github.com/stripe/stripe-java.git'
153141
branch = 'gh-pages'

justfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
set quiet
2+
3+
import? '../sdk-codegen/justfile'
4+
5+
_default:
6+
just --list --unsorted
7+
8+
# ⭐ run the whole test suite
9+
[no-exit-message]
10+
test *args:
11+
./gradlew test {{ args }}
12+
13+
# run a single test
14+
test-one modelPath: (test "--tests" modelPath)
15+
16+
# ⭐ format all files
17+
[no-exit-message]
18+
format:
19+
./gradlew spotlessApply
20+
21+
# check, but don't change, the formatting
22+
[no-exit-message]
23+
format-check:
24+
./gradlew spotlessCheck
25+
26+
# called by tooling
27+
[private]
28+
update-version version:
29+
echo "{{ version }}" > VERSION
30+
perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v{{ version }}-blue|' README.md
31+
perl -pi -e 's|https:\/\/search\.maven\.org\/remotecontent\?filepath=com\/stripe\/stripe-java\/[.\d\-\w]+\/stripe-java-[.\d\-\w]+.jar|https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/{{ version }}/stripe-java-{{ version }}.jar|' README.md
32+
perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:{{ version }}"|' README.md
33+
perl -pi -e 's|<version>[.\d\-\w]+<\/version>|<version>{{ version }}</version>|' README.md
34+
perl -pi -e 's|VERSION_NAME=[.\d\-\w]+|VERSION_NAME={{ version }}|' gradle.properties
35+
perl -pi -e 's|public static final String VERSION = "[.\d\-\w]+";|public static final String VERSION = "{{ version }}";|' src/main/java/com/stripe/Stripe.java

src/test/java/com/stripe/functional/GeneratedExamples.java

+44
Original file line numberDiff line numberDiff line change
@@ -11940,6 +11940,50 @@ public void testTerminalReadersProcessPaymentIntentPostServices() throws StripeE
1194011940
null);
1194111941
}
1194211942

11943+
@Test
11944+
public void testTerminalReadersProcessSetupIntentPost() throws StripeException {
11945+
com.stripe.model.terminal.Reader resource =
11946+
com.stripe.model.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx");
11947+
11948+
com.stripe.param.terminal.ReaderProcessSetupIntentParams params =
11949+
com.stripe.param.terminal.ReaderProcessSetupIntentParams.builder()
11950+
.setSetupIntent("seti_xxxxxxxxxxxxx")
11951+
.setAllowRedisplay(
11952+
com.stripe.param.terminal.ReaderProcessSetupIntentParams.AllowRedisplay.ALWAYS)
11953+
.build();
11954+
11955+
com.stripe.model.terminal.Reader reader = resource.processSetupIntent(params);
11956+
assertNotNull(reader);
11957+
verifyRequest(
11958+
BaseAddress.API,
11959+
ApiResource.RequestMethod.POST,
11960+
"/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent",
11961+
params.toMap(),
11962+
null);
11963+
}
11964+
11965+
@Test
11966+
public void testTerminalReadersProcessSetupIntentPostServices() throws StripeException {
11967+
StripeClient client = new StripeClient(networkSpy);
11968+
11969+
com.stripe.param.terminal.ReaderProcessSetupIntentParams params =
11970+
com.stripe.param.terminal.ReaderProcessSetupIntentParams.builder()
11971+
.setSetupIntent("seti_xxxxxxxxxxxxx")
11972+
.setAllowRedisplay(
11973+
com.stripe.param.terminal.ReaderProcessSetupIntentParams.AllowRedisplay.ALWAYS)
11974+
.build();
11975+
11976+
com.stripe.model.terminal.Reader reader =
11977+
client.terminal().readers().processSetupIntent("tmr_xxxxxxxxxxxxx", params);
11978+
assertNotNull(reader);
11979+
verifyRequest(
11980+
BaseAddress.API,
11981+
ApiResource.RequestMethod.POST,
11982+
"/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent",
11983+
params.toMap(),
11984+
null);
11985+
}
11986+
1194311987
@Test
1194411988
public void testTestHelpersCustomersFundCashBalancePost() throws StripeException {
1194511989
Customer resource = Customer.retrieve("cus_123");

0 commit comments

Comments
 (0)