Skip to content

Commit

Permalink
build: update test-only dependency - Jackson
Browse files Browse the repository at this point in the history
Jackson is a transitive dependency of 'json-snapshot'. In order to
use Jackson as Java Module, we update it to the latest version instead
of patching it.

Unfortunately, 'json-snapshot' has not been updated in years and the
way we used it is not compatible with the latest Jackson version.

By adjusting the test setup as described here, we make it work:
json-snapshot/json-snapshot.github.io#27 (comment)

Signed-off-by: Jendrik Johannes <[email protected]>
  • Loading branch information
jjohannes committed Oct 9, 2024
1 parent d0233c0 commit a26d978
Show file tree
Hide file tree
Showing 106 changed files with 181 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ extraJavaModuleInfo {
module("com.google.api.grpc:proto-google-common-protos", "com.google.api.grpc.common")

// Testing only
module("com.fasterxml.jackson.core:jackson-annotations", "com.fasterxml.jackson.annotations")
module("com.fasterxml.jackson.core:jackson-core", "com.fasterxml.jackson.core")
module("com.fasterxml.jackson.core:jackson-databind", "com.fasterxml.jackson.databind") {
exportAllPackages()
requireAllDefinedDependencies()
requires("java.sql")
}
module("io.grpc:grpc-netty-shaded", "io.grpc.netty.shaded") {
exportAllPackages()
requireAllDefinedDependencies()
Expand Down
3 changes: 3 additions & 0 deletions sdk-dependency-versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ dependencies.constraints {
}

// Testing
api("com.fasterxml.jackson.core:jackson-core:2.18.0") {
because("com.fasterxml.jackson.core")
}
api("io.github.cdimascio:java-dotenv:5.3.1") {
because("java.dotenv")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AccountAllowanceApproveTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AccountAllowanceDeleteTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class AccountBalanceQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AccountCreateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AccountDeleteTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AccountIdTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
mainnetClient = Client.forMainnet();
testnetClient = Client.forTestnet();
previewnetClient = Client.forPreviewnet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class AccountInfoQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class AccountInfoTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class AccountRecordsQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class AccountStakersQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AccountUpdateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class AllowancesTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class AssessedCustomFeeTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class ContractByteCodeQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ContractCallQueryTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ContractCreateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ContractDeleteTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ContractExecuteTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class ContractFunctionParametersTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class ContractIdTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class ContractInfoQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ContractInfoTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ContractLogInfoTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ContractNonceInfoTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ContractUpdateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class CryptoTransferTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class CustomFeeListTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class CustomFixedFeeTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CustomFractionalFeeTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CustomRoyaltyFeeTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class DelegateContractIdTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EthereumTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class FeeSchedulesTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class FileAppendTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class FileContentsQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class FileCreateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class FileDeleteTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class FileIdTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class FileInfoQueryTest {
@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FileInfoTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class FileUpdateTransactionTest {

@BeforeAll
public static void beforeAll() {
SnapshotMatcher.start();
SnapshotMatcher.start(Snapshot::asJsonString);
}

@AfterAll
Expand Down
Loading

0 comments on commit a26d978

Please sign in to comment.