Skip to content

Commit 5a48a3d

Browse files
author
Jonathan Wenger
committed
Update tests to run all the time in pipeline
1 parent 1a78902 commit 5a48a3d

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

.github/workflows/Deploy.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313

1414
- name: Set env
1515
run: |
@@ -20,7 +20,7 @@ jobs:
2020
echo ${{ env.VERSION }}
2121
2222
- name: Set up Maven Central Repository
23-
uses: actions/setup-java@v2
23+
uses: actions/setup-java@v3
2424
with:
2525
java-version: "11"
2626
distribution: "adopt"
@@ -38,20 +38,30 @@ jobs:
3838
- name: Check Imported GPG Keys
3939
run: gpg --list-secret-keys --keyid-format LONG
4040

41-
- name: Retrieve bearer token
42-
id: get_bearer_token
41+
- name: Retrieve bearer token for EInvoicing
42+
id: get_bearer_token_einvoicing
4343
run: |
4444
response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \
4545
-H "Content-Type: application/x-www-form-urlencoded" \
4646
-d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}")
4747
token=$(echo $response | jq -r '.access_token')
4848
echo "BEARER_TOKEN_EINVOICING=${token}" >> $GITHUB_ENV
4949
50+
- name: Retrieve bearer token for A1099
51+
id: get_bearer_token_a1099
52+
run: |
53+
response=$(curl -X POST ${{secrets.AI_SBX_URL}}/connect/token \
54+
-H "Content-Type: application/x-www-form-urlencoded" \
55+
-d "grant_type=client_credentials&client_id=${{secrets.AI_CLIENT_ID_A1099}}&client_secret=${{secrets.AI_CLIENT_SECRET_A1099}}")
56+
token=$(echo $response | jq -r '.access_token')
57+
echo "BEARER_TOKEN_A1099=${token}" >> $GITHUB_ENV
58+
5059
- name: Build with Maven
51-
run: mvn --batch-mode --update-snapshots verify -DprofileIdEnabled=true -Dtest=EInvoicingTest -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Psign-artifacts
60+
run: mvn --batch-mode --update-snapshots verify -DprofileIdEnabled=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Psign-artifacts
5261
env:
5362
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
5463
BEARER_TOKEN_EINVOICING: ${{ env.BEARER_TOKEN_EINVOICING }}
64+
BEARER_TOKEN_A1099: ${{ env.BEARER_TOKEN_A1099 }}
5565

5666
- name: Update resources
5767
uses: test-room-7/action-update-file@v1

.github/workflows/test.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
- name: Set up Maven Central Repository
16-
uses: actions/setup-java@v2
16+
uses: actions/setup-java@v3
1717
with:
1818
java-version: "11"
1919
distribution: "adopt"
@@ -24,22 +24,32 @@ jobs:
2424
- name: Install GPG secret key
2525
run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
2626

27-
- name: Retrieve bearer token
28-
id: get_bearer_token
27+
- name: Retrieve bearer token for EInvoicing
28+
id: get_bearer_token_einvoicing
2929
run: |
3030
response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \
3131
-H "Content-Type: application/x-www-form-urlencoded" \
3232
-d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}")
3333
token=$(echo $response | jq -r '.access_token')
3434
echo "BEARER_TOKEN_EINVOICING=${token}" >> $GITHUB_ENV
3535
36+
- name: Retrieve bearer token for A1099
37+
id: get_bearer_token_a1099
38+
run: |
39+
response=$(curl -X POST ${{secrets.AI_SBX_URL}}/connect/token \
40+
-H "Content-Type: application/x-www-form-urlencoded" \
41+
-d "grant_type=client_credentials&client_id=${{secrets.AI_CLIENT_ID_A1099}}&client_secret=${{secrets.AI_CLIENT_SECRET_A1099}}")
42+
token=$(echo $response | jq -r '.access_token')
43+
echo "BEARER_TOKEN_A1099=${token}" >> $GITHUB_ENV
44+
3645
- name: Clean and Compile with Maven
3746
run: mvn clean compile
3847

3948
- name: Compile the tests
4049
run: mvn test-compile
4150

4251
- name: Test With Maven
43-
run: mvn -Dtest=EInvoicingTest test
52+
run: mvn test
4453
env:
4554
BEARER_TOKEN_EINVOICING: ${{ env.BEARER_TOKEN_EINVOICING }}
55+
BEARER_TOKEN_A1099: ${{ env.BEARER_TOKEN_A1099 }}

src/test/java/Avalara/SDK/api/A1099/V2/A1099Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public void setUp() throws Exception {
2929
configuration.setAppName("Test");
3030
configuration.setAppVersion("1.0");
3131
configuration.setMachineName("LocalBox");
32-
configuration.setBearerToken(dotenv.get("A1099_BEARER_TOKEN"));
33-
configuration.setEnvironment(AvaTaxEnvironment.QA);
32+
configuration.setBearerToken(dotenv.get("BEARER_TOKEN_A1099"));
33+
configuration.setEnvironment(AvaTaxEnvironment.Sandbox);
3434
// Override base URL if needed:
3535
// configuration.setTestBasePath(dotenv.get("A1099_BASE_URL"));
3636

0 commit comments

Comments
 (0)