Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .github/workflows/javaci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
${{ runner.os }}-m2-
- name: Check code style
run: mvn -B checkstyle:check --no-transfer-progress
- name: Check Java Formatting
run: mvn spotless:check --no-transfer-progress

java-test:
name: Build and Test
Expand Down
7 changes: 1 addition & 6 deletions src/test/java/com/adyen/BalanceControlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ public class BalanceControlTest extends BaseTest {

@Test
public void baseUrlOnTest() throws NoSuchFieldException, IllegalAccessException {
Client client =
new Client(
new Config()
.apiKey("test")
.environment(Environment.TEST)
.liveEndpointUrlPrefix("myCompany"));
Client client = new Client(new Config().apiKey("test").environment(Environment.TEST).liveEndpointUrlPrefix("myCompany"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The single-line instantiation of Client and Config is difficult to read and exceeds the standard 100-character line limit (this line is 114 characters). It is also inconsistent with the formatting used elsewhere in this file (e.g., lines 38-43). Using the more concise Client constructor is recommended to improve readability and maintain consistency.

Suggested change
Client client = new Client(new Config().apiKey("test").environment(Environment.TEST).liveEndpointUrlPrefix("myCompany"));
Client client = new Client("test", Environment.TEST, "myCompany");
References
  1. The Google Java Style Guide recommends a column limit of 100 characters to ensure code readability. (link)


BalanceControlApi balanceControlApi = new BalanceControlApi(client);
// get field by reflection (it is protected)
Expand Down
Loading