Skip to content

Commit 21c42a9

Browse files
authored
Second batch of test and functionality updates (#40)
* feat: second batch of test updates and functionality fixes * feat: new env variable for CI * fix: removed unused logs * fix: wallet tests fixes * fix: CI env naming
1 parent f96fb63 commit 21c42a9

File tree

838 files changed

+33533
-13181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

838 files changed

+33533
-13181
lines changed

.github/workflows/CI-appsec-blackduck-master-include_diagnostics.yml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
branches:
77
- main
88
paths:
9-
- 'build.gradle'
9+
- "build.gradle"
1010

1111
jobs:
1212
blackduck-scan:
13-
runs-on: [ ubuntu-latest ]
13+
runs-on: [ubuntu-latest]
1414
steps:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-java@v3
@@ -30,6 +30,9 @@ jobs:
3030
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
3131
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
3232
access_token: ${{ secrets.UNIT_TOKEN }}
33+
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
34+
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
35+
wallet_terms: ${{ secrets.WALLET_TERMS }}
3336

3437
- name: Black Duck Full Scan
3538
uses: synopsys-sig/[email protected]
@@ -42,46 +45,45 @@ jobs:
4245
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
4346
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
4447
blackduck_scan_full: true
45-
48+
4649
### Accepts Multiple Values
47-
blackduck_scan_failure_severities: 'BLOCKER,CRITICAL'
48-
50+
blackduck_scan_failure_severities: "BLOCKER,CRITICAL"
51+
4952
### Uncomment below configuration to enable automatic fix pull request creation if vulnerabilities are reported
5053
blackduck_fixpr_enabled: true
5154
blackduck_fixpr_maxCount: 5
52-
blackduck_fixpr_filter_severities: 'CRITICAL,HIGH'
53-
blackduck_fixpr_useUpgradeGuidance: 'SHORT_TERM,LONG_TERM'
55+
blackduck_fixpr_filter_severities: "CRITICAL,HIGH"
56+
blackduck_fixpr_useUpgradeGuidance: "SHORT_TERM,LONG_TERM"
5457
github_token: ${{ secrets.GITHUB_TOKEN }} # Mandatory when blackduck_fixpr_enabled is set to 'true'
55-
58+
5659
### Uncomment below configuration if Synopsys Bridge diagnostic files needs to be uploaded
5760
include_diagnostics: true
5861

5962
- name: If failed - Configure 1Password Service Account For Slack Webhook URL Secret
6063
uses: 1password/load-secrets-action/configure@v1
6164
if: ${{ failure() }}
6265
with:
63-
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
66+
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
6467
- name: If failed - Load Slack Webhook URL Secret
6568
uses: 1password/load-secrets-action@v1
6669
if: ${{ failure() }}
6770
with:
68-
export-env: true
71+
export-env: true
6972
env:
70-
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
71-
- name: If failed - Report failure to Slack
73+
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
74+
- name: If failed - Report failure to Slack
7275
#Slack channel: appsec-blackduck-alerts
73-
uses: ravsamhq/notify-slack-action@v2
76+
uses: ravsamhq/notify-slack-action@v2
7477
if: ${{ failure() }}
7578
with:
76-
status: ${{ job.status }}
77-
token: ${{ secrets.GITHUB_TOKEN }}
78-
notification_title: "{workflow} has {status_message}"
79-
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
80-
footer: "Linked Run <{run_url}|{repo}>"
81-
notify_when: "failure"
82-
mention_users: "U040AD4BT42"
83-
mention_users_when: "failure,warnings"
84-
mention_groups: "!channel"
79+
status: ${{ job.status }}
80+
token: ${{ secrets.GITHUB_TOKEN }}
81+
notification_title: "{workflow} has {status_message}"
82+
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
83+
footer: "Linked Run <{run_url}|{repo}>"
84+
notify_when: "failure"
85+
mention_users: "U040AD4BT42"
86+
mention_users_when: "failure,warnings"
87+
mention_groups: "!channel"
8588
env:
86-
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
87-
89+
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}

.github/workflows/CI-appsec-blackduck-master.yml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ name: CI-AppSec [Master]
22
on:
33
schedule:
44
#At 13:00 on every day-of-week from Sunday through Thursday.
5-
- cron: '0 13 * * SUN-THU'
5+
- cron: "0 13 * * SUN-THU"
66
workflow_dispatch:
77
#The workflow will only run when a push that includes a change to the build.gradle file is made in the main branch.
88
push:
99
branches:
1010
- main
1111
paths:
12-
- 'build.gradle'
12+
- "build.gradle"
1313

1414
jobs:
1515
blackduck-scan:
16-
runs-on: [ ubuntu-latest ]
16+
runs-on: [ubuntu-latest]
1717
steps:
1818
- uses: actions/checkout@v3
1919
- uses: actions/setup-java@v3
@@ -30,6 +30,9 @@ jobs:
3030
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
3131
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
3232
access_token: ${{ secrets.UNIT_TOKEN }}
33+
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
34+
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
35+
wallet_terms: ${{ secrets.WALLET_TERMS }}
3336

3437
- name: Black Duck Full Scan
3538
uses: synopsys-sig/[email protected]
@@ -42,46 +45,45 @@ jobs:
4245
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
4346
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
4447
blackduck_scan_full: true
45-
48+
4649
### Accepts Multiple Values
47-
blackduck_scan_failure_severities: 'BLOCKER,CRITICAL'
48-
50+
blackduck_scan_failure_severities: "BLOCKER,CRITICAL"
51+
4952
### Uncomment below configuration to enable automatic fix pull request creation if vulnerabilities are reported
5053
blackduck_fixpr_enabled: true
5154
blackduck_fixpr_maxCount: 5
52-
blackduck_fixpr_filter_severities: 'CRITICAL,HIGH'
53-
blackduck_fixpr_useUpgradeGuidance: 'SHORT_TERM,LONG_TERM'
55+
blackduck_fixpr_filter_severities: "CRITICAL,HIGH"
56+
blackduck_fixpr_useUpgradeGuidance: "SHORT_TERM,LONG_TERM"
5457
github_token: ${{ secrets.GITHUB_TOKEN }} # Mandatory when blackduck_fixpr_enabled is set to 'true'
55-
58+
5659
### Uncomment below configuration if Synopsys Bridge diagnostic files needs to be uploaded
5760
# include_diagnostics: true
5861

5962
- name: If failed - Configure 1Password Service Account For Slack Webhook URL Secret
6063
uses: 1password/load-secrets-action/configure@v1
6164
if: ${{ failure() }}
6265
with:
63-
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
66+
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
6467
- name: If failed - Load Slack Webhook URL Secret
6568
uses: 1password/load-secrets-action@v1
6669
if: ${{ failure() }}
6770
with:
68-
export-env: true
71+
export-env: true
6972
env:
70-
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
71-
- name: If failed - Report failure to Slack
73+
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
74+
- name: If failed - Report failure to Slack
7275
#Slack channel: appsec-blackduck-alerts
73-
uses: ravsamhq/notify-slack-action@v2
76+
uses: ravsamhq/notify-slack-action@v2
7477
if: ${{ failure() }}
7578
with:
76-
status: ${{ job.status }}
77-
token: ${{ secrets.GITHUB_TOKEN }}
78-
notification_title: "{workflow} has {status_message}"
79-
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
80-
footer: "Linked Run <{run_url}|{repo}>"
81-
notify_when: "failure"
82-
mention_users: "U040AD4BT42"
83-
mention_users_when: "failure,warnings"
84-
mention_groups: "!channel"
79+
status: ${{ job.status }}
80+
token: ${{ secrets.GITHUB_TOKEN }}
81+
notification_title: "{workflow} has {status_message}"
82+
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
83+
footer: "Linked Run <{run_url}|{repo}>"
84+
notify_when: "failure"
85+
mention_users: "U040AD4BT42"
86+
mention_users_when: "failure,warnings"
87+
mention_groups: "!channel"
8588
env:
86-
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
87-
89+
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}

.github/workflows/CI.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
2828
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
2929
access_token: ${{ secrets.UNIT_TOKEN }}
30+
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
31+
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
32+
wallet_terms: ${{ secrets.WALLET_TERMS }}
3033

3134
- name: Store reports
3235
if: failure()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ p.setNumber("5555555555");
6363
p.setCountryCode("1");
6464
attr.setPhone(p);
6565
attr.setIdempotencyKey("3a1a33be-4e12-4603-9ed0-820922389fb8");
66-
attr.setOccupation(Occupation.ARCHITECTORENGINEER);
66+
attr.setOccupation(Occupation.ARCHITECT_OR_ENGINEER);
6767

6868
createIndividualApplication.setAttributes(attr);
6969

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ ext {
123123
jackson_version = "2.14.1"
124124
jakarta_annotation_version = "2.1.1"
125125
junit_version = "4.13.2"
126+
httpmime_version = "4.5.13"
126127
}
127128

128129
dependencies {
@@ -134,6 +135,8 @@ dependencies {
134135
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
135136
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
136137
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
138+
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
139+
implementation "commons-io:commons-io:2.5"
137140
testImplementation "junit:junit:$junit_version"
138141
}
139142

@@ -169,6 +172,10 @@ spotless {
169172
}
170173

171174
test {
175+
testLogging {
176+
showStandardStreams = true
177+
}
178+
172179
useJUnit()
173180
}
174181
// // Enable JUnit 5 (Gradle 4.6+).

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@
234234
<version>${jakarta-annotation-version}</version>
235235
<scope>provided</scope>
236236
</dependency>
237+
<dependency>
238+
<groupId>org.apache.httpcomponents</groupId>
239+
<artifactId>httpmime</artifactId>
240+
<version>${httpmime-version}</version>
241+
</dependency>
237242

238243
<!-- test dependencies -->
239244
<dependency>
@@ -253,5 +258,6 @@
253258
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
254259
<junit-version>4.13.2</junit-version>
255260
<spotless.version>2.27.2</spotless.version>
261+
<httpmime-version>4.5.14</httpmime-version>
256262
</properties>
257263
</project>

src/main/java/unit/java/sdk/ApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* <p>The setter methods of this class return the current object to facilitate
5252
* a fluent style of configuration.</p>
5353
*/
54-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
54+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
5555
public class ApiClient {
5656

5757
private HttpClient.Builder builder;
@@ -66,7 +66,7 @@ public class ApiClient {
6666
private Duration readTimeout;
6767
private Duration connectTimeout;
6868

69-
private static String valueToString(Object value) {
69+
public static String valueToString(Object value) {
7070
if (value == null) {
7171
return "";
7272
}

src/main/java/unit/java/sdk/ApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import java.net.http.HttpHeaders;
1717

18-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
18+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
1919
public class ApiException extends Exception {
2020
private static final long serialVersionUID = 1L;
2121

src/main/java/unit/java/sdk/ApiResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @param <T> The type of data that is deserialized from response body
2323
*/
24-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
24+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
2525
public class ApiResponse<T> {
2626
final private int statusCode;
2727
final private Map<String, List<String>> headers;

src/main/java/unit/java/sdk/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package unit.java.sdk;
1515

16-
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
16+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
1717
public class Configuration {
1818
public static final String VERSION = "0.1.0";
1919

0 commit comments

Comments
 (0)