From a192116736fbb76c44b1b3d813096142b96cfc1d Mon Sep 17 00:00:00 2001 From: alfonsobries Date: Thu, 22 Aug 2024 14:20:04 +0000 Subject: [PATCH] style: resolve style guide violations --- .../org/arkecosystem/client/ArkClient.java | 3 ++- .../org/arkecosystem/client/ClientManager.java | 4 +--- .../org/arkecosystem/client/ArkClientTest.java | 7 ++++--- .../arkecosystem/client/ClientManagerTest.java | 18 +++++++++++------- .../org/arkecosystem/client/MockHelper.java | 2 +- .../arkecosystem/client/api/ApiNodesTest.java | 2 +- .../client/api/BlockchainTest.java | 2 +- .../arkecosystem/client/api/BlocksTest.java | 5 ++--- .../arkecosystem/client/api/CommitsTest.java | 2 +- .../arkecosystem/client/api/DelegatesTest.java | 2 +- .../org/arkecosystem/client/api/NodeTest.java | 2 +- .../org/arkecosystem/client/api/PeersTest.java | 5 ++--- .../arkecosystem/client/api/RoundsTest.java | 5 ++--- .../client/api/TransactionsTest.java | 5 ++--- .../org/arkecosystem/client/api/VotesTest.java | 5 ++--- .../arkecosystem/client/api/WalletsTest.java | 5 ++--- 16 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/main/java/org/arkecosystem/client/ArkClient.java b/src/main/java/org/arkecosystem/client/ArkClient.java index 3dc3c67..15669fb 100644 --- a/src/main/java/org/arkecosystem/client/ArkClient.java +++ b/src/main/java/org/arkecosystem/client/ArkClient.java @@ -11,7 +11,8 @@ public class ArkClient { /** * Constructor to create an instance of ArkClient. * - * @param hostOrHosts Can be a string representing the host URL or a map with different types of hosts. + * @param hostOrHosts Can be a string representing the host URL or a map with different types of + * hosts. */ public ArkClient(Object hostOrHosts) { this.client = new Client(hostOrHosts); diff --git a/src/main/java/org/arkecosystem/client/ClientManager.java b/src/main/java/org/arkecosystem/client/ClientManager.java index 2e685b2..0202ca7 100644 --- a/src/main/java/org/arkecosystem/client/ClientManager.java +++ b/src/main/java/org/arkecosystem/client/ClientManager.java @@ -78,9 +78,7 @@ public void disconnect(String name) { this.clients.remove(name); } - /** - * Disconnect from the default client. - */ + /** Disconnect from the default client. */ public void disconnect() { disconnect(null); } diff --git a/src/test/java/org/arkecosystem/client/ArkClientTest.java b/src/test/java/org/arkecosystem/client/ArkClientTest.java index a007e9d..8b6852d 100644 --- a/src/test/java/org/arkecosystem/client/ArkClientTest.java +++ b/src/test/java/org/arkecosystem/client/ArkClientTest.java @@ -1,12 +1,11 @@ package org.arkecosystem.client; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Map; - import org.junit.jupiter.api.Test; class ArkClientTest { @@ -63,6 +62,8 @@ void shouldSetHost() { void shouldThrowExceptionIfHostTypeIsInvalid() { ArkClient client = new ArkClient("https://old-host.com/api"); - assertThrows(IllegalArgumentException.class, () -> client.setHost("https://new-host.com/api", "other")); + assertThrows( + IllegalArgumentException.class, + () -> client.setHost("https://new-host.com/api", "other")); } } diff --git a/src/test/java/org/arkecosystem/client/ClientManagerTest.java b/src/test/java/org/arkecosystem/client/ClientManagerTest.java index fd90f8e..f176108 100644 --- a/src/test/java/org/arkecosystem/client/ClientManagerTest.java +++ b/src/test/java/org/arkecosystem/client/ClientManagerTest.java @@ -26,9 +26,11 @@ public void shouldThrowIfClientAlreadyExists() { ClientManager manager = new ClientManager(); manager.connect(map.get("host").toString(), "dummy-client"); - assertThrows(IllegalArgumentException.class, () -> { - manager.connect(map.get("host").toString(), "dummy-client"); - }); + assertThrows( + IllegalArgumentException.class, + () -> { + manager.connect(map.get("host").toString(), "dummy-client"); + }); } @Test @@ -59,9 +61,11 @@ public void client() { public void shouldThrowIfClientDoesNotExist() { ClientManager manager = new ClientManager(); - assertThrows(IllegalArgumentException.class, () -> { - manager.client("non-existent-client"); - }); + assertThrows( + IllegalArgumentException.class, + () -> { + manager.client("non-existent-client"); + }); } @Test @@ -98,4 +102,4 @@ public void getClients() { assertEquals(0, manager.getClients().size()); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/MockHelper.java b/src/test/java/org/arkecosystem/client/MockHelper.java index 6f44f69..c7a9aac 100644 --- a/src/test/java/org/arkecosystem/client/MockHelper.java +++ b/src/test/java/org/arkecosystem/client/MockHelper.java @@ -24,4 +24,4 @@ public static ArkClient client() { return client; } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/ApiNodesTest.java b/src/test/java/org/arkecosystem/client/api/ApiNodesTest.java index 9e35dad..1967767 100644 --- a/src/test/java/org/arkecosystem/client/api/ApiNodesTest.java +++ b/src/test/java/org/arkecosystem/client/api/ApiNodesTest.java @@ -24,4 +24,4 @@ void allWithParams() throws IOException { client.api().apiNodes.param("page", 1).param("limit", 100).all(); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/BlockchainTest.java b/src/test/java/org/arkecosystem/client/api/BlockchainTest.java index 35e3db2..42bbd79 100644 --- a/src/test/java/org/arkecosystem/client/api/BlockchainTest.java +++ b/src/test/java/org/arkecosystem/client/api/BlockchainTest.java @@ -16,4 +16,4 @@ void all() throws IOException { Map actual = client.api().blockchain.all(); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/BlocksTest.java b/src/test/java/org/arkecosystem/client/api/BlocksTest.java index 564affb..584b983 100644 --- a/src/test/java/org/arkecosystem/client/api/BlocksTest.java +++ b/src/test/java/org/arkecosystem/client/api/BlocksTest.java @@ -20,8 +20,7 @@ void all() throws IOException { @Test void allWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().blocks.param("page", 1).param("limit", 100).all(); + Map actual = client.api().blocks.param("page", 1).param("limit", 100).all(); assertTrue((boolean) actual.get("success")); } @@ -60,4 +59,4 @@ void transactionsWithParams() throws IOException { client.api().blocks.param("page", 1).param("limit", 100).transactions("dummy"); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/CommitsTest.java b/src/test/java/org/arkecosystem/client/api/CommitsTest.java index d605502..1da3631 100644 --- a/src/test/java/org/arkecosystem/client/api/CommitsTest.java +++ b/src/test/java/org/arkecosystem/client/api/CommitsTest.java @@ -16,4 +16,4 @@ void show() throws IOException { Map actual = client.api().commits.show(123456); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/DelegatesTest.java b/src/test/java/org/arkecosystem/client/api/DelegatesTest.java index 0f40bf3..ffe8a5a 100644 --- a/src/test/java/org/arkecosystem/client/api/DelegatesTest.java +++ b/src/test/java/org/arkecosystem/client/api/DelegatesTest.java @@ -53,4 +53,4 @@ void votersWithParams() throws IOException { client.api().delegates.param("page", 1).param("limit", 100).voters("dummy"); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/NodeTest.java b/src/test/java/org/arkecosystem/client/api/NodeTest.java index 61e8c24..2d288d0 100644 --- a/src/test/java/org/arkecosystem/client/api/NodeTest.java +++ b/src/test/java/org/arkecosystem/client/api/NodeTest.java @@ -51,4 +51,4 @@ void crypto() throws IOException { Map actual = client.api().node.crypto(); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/PeersTest.java b/src/test/java/org/arkecosystem/client/api/PeersTest.java index 0958192..64f8575 100644 --- a/src/test/java/org/arkecosystem/client/api/PeersTest.java +++ b/src/test/java/org/arkecosystem/client/api/PeersTest.java @@ -20,8 +20,7 @@ void all() throws IOException { @Test void allWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().peers.param("page", 1).param("limit", 100).all(); + Map actual = client.api().peers.param("page", 1).param("limit", 100).all(); assertTrue((boolean) actual.get("success")); } @@ -31,4 +30,4 @@ void show() throws IOException { Map actual = client.api().peers.show("dummy"); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/RoundsTest.java b/src/test/java/org/arkecosystem/client/api/RoundsTest.java index b4c1b24..e4ce579 100644 --- a/src/test/java/org/arkecosystem/client/api/RoundsTest.java +++ b/src/test/java/org/arkecosystem/client/api/RoundsTest.java @@ -27,8 +27,7 @@ void all() throws IOException { @Test void allWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().rounds.param("page", 1).param("limit", 100).all(); + Map actual = client.api().rounds.param("page", 1).param("limit", 100).all(); assertTrue((boolean) actual.get("success")); } @@ -38,4 +37,4 @@ void show() throws IOException { Map actual = client.api().rounds.show(12345); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/TransactionsTest.java b/src/test/java/org/arkecosystem/client/api/TransactionsTest.java index ea6e2e5..caa385a 100644 --- a/src/test/java/org/arkecosystem/client/api/TransactionsTest.java +++ b/src/test/java/org/arkecosystem/client/api/TransactionsTest.java @@ -50,8 +50,7 @@ void allUnconfirmed() throws IOException { @Test void allUnconfirmedWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().transactions.param("page", 1).allUnconfirmed(); + Map actual = client.api().transactions.param("page", 1).allUnconfirmed(); assertTrue((boolean) actual.get("success")); } @@ -82,4 +81,4 @@ void schemas() throws IOException { Map actual = client.api().transactions.schemas(); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/VotesTest.java b/src/test/java/org/arkecosystem/client/api/VotesTest.java index c82fe11..c97aef7 100644 --- a/src/test/java/org/arkecosystem/client/api/VotesTest.java +++ b/src/test/java/org/arkecosystem/client/api/VotesTest.java @@ -20,8 +20,7 @@ void all() throws IOException { @Test void allWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().votes.param("page", 1).param("limit", 100).all(); + Map actual = client.api().votes.param("page", 1).param("limit", 100).all(); assertTrue((boolean) actual.get("success")); } @@ -31,4 +30,4 @@ void show() throws IOException { Map actual = client.api().votes.show("dummy"); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +} diff --git a/src/test/java/org/arkecosystem/client/api/WalletsTest.java b/src/test/java/org/arkecosystem/client/api/WalletsTest.java index 0201364..e5864e8 100644 --- a/src/test/java/org/arkecosystem/client/api/WalletsTest.java +++ b/src/test/java/org/arkecosystem/client/api/WalletsTest.java @@ -42,8 +42,7 @@ void transactions() throws IOException { @Test void transactionsWithParams() throws IOException { ArkClient client = MockHelper.client(); - Map actual = - client.api().wallets.param("page", 1).transactions("dummy"); + Map actual = client.api().wallets.param("page", 1).transactions("dummy"); assertTrue((boolean) actual.get("success")); } @@ -104,4 +103,4 @@ void topWithParams() throws IOException { Map actual = client.api().wallets.param("page", 1).top(); assertTrue((boolean) actual.get("success")); } -} \ No newline at end of file +}