diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 24dd401690..11b5bf0d27 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,11 @@ updates: schedule: interval: weekly open-pull-requests-limit: 10 +- package-ecosystem: gradle + directory: "/gradle/plugins" + schedule: + interval: weekly + open-pull-requests-limit: 10 - package-ecosystem: github-actions directory: "/" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27dcbf4703..88707750a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,12 +45,12 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 with: cache-read-only: false - name: Compile SDK & Javadoc - run: ./gradlew assemble :sdk:javadoc -Dfile.encoding=UTF-8 --scan + run: ./gradlew assemble :sdk:javadoc --scan unit-tests: name: Unit Tests @@ -80,7 +80,7 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Install Local Node run: npm install @hashgraph/hedera-local @@ -88,6 +88,9 @@ jobs: - name: Compile Code run: ./gradlew assemble --scan + - name: Gradle Dependency Scopes Check + run: ./gradlew checkAllModuleInfo --continue --scan + - name: Start Local Node run: npx @hashgraph/hedera-local start -d --network local @@ -138,8 +141,11 @@ jobs: distribution: temurin java-version: 17 + - name: Setup Android SDK + uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3.2.1 + - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Install Local Node run: npm install @hashgraph/hedera-local @@ -147,6 +153,9 @@ jobs: - name: Compile Code run: ./gradlew assemble --scan + - name: Compile Code - Android Example + run: ./gradlew -p example-android assemble --scan + - name: Start the local node run: npx @hashgraph/hedera-local start -d --network local @@ -187,7 +196,7 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Install Local Node run: npm install @hashgraph/hedera-local @@ -199,8 +208,7 @@ jobs: run: npx @hashgraph/hedera-local start -d --network local - name: Run Tests - run: | - cd tck && ./gradlew test && cd .. + run: ./gradlew :tck:test - name: Stop the local node run: npx @hashgraph/hedera-local stop diff --git a/.github/workflows/disabled/main.yml b/.github/workflows/disabled/main.yml index 56a80bbfd6..b61f2ba5a4 100644 --- a/.github/workflows/disabled/main.yml +++ b/.github/workflows/disabled/main.yml @@ -68,4 +68,4 @@ jobs: cd hedera-services docker-compose up & cd ../hedera-sdk-java - ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID integrationTest + ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID testIntegration diff --git a/.github/workflows/disabled/previewnet.yml b/.github/workflows/disabled/previewnet.yml index 667a841cf1..f9a36c6080 100644 --- a/.github/workflows/disabled/previewnet.yml +++ b/.github/workflows/disabled/previewnet.yml @@ -51,4 +51,4 @@ jobs: OPERATOR_KEY: ${{ secrets.PREVIEWNET_OPERATOR_KEY }} OPERATOR_ID: ${{ secrets.PREVIEWNET_OPERATOR_ID }} HEDERA_NETWORK: "previewnet" - run: ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY integrationTest + run: ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY testIntegration diff --git a/.github/workflows/disabled/testnet.yml b/.github/workflows/disabled/testnet.yml index 0f5076ef10..97e9768795 100644 --- a/.github/workflows/disabled/testnet.yml +++ b/.github/workflows/disabled/testnet.yml @@ -31,7 +31,7 @@ jobs: - name: Compile Tests run: ./gradlew compileTestJava - name: Compile Integration Tests - run: ./gradlew compileIntegrationTestJava + run: ./gradlew compileTestIntegrationJava - name: Compile Examples run: ./gradlew :examples:compileJava diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 68e6b36d9e..a21f28fff1 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -38,13 +38,13 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 - name: Compile SDK run: ./gradlew compileJava --scan - name: Generate Javadoc - run: ./gradlew sdk:javadoc -Dfile.encoding=UTF-8 --scan + run: ./gradlew sdk:javadoc --scan - name: Pages uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index c89c07fcc3..7cf0455ab2 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -54,7 +54,7 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 with: cache-read-only: false @@ -66,7 +66,7 @@ jobs: if: ${{ github.event_name == 'push' }} run: | if [[ "${{ steps.tag.outputs.version }}" != "${{ steps.project.outputs.version }}" ]]; then - echo "::error file=version.gradle,line=5,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.gradle' file before tagging." + echo "::error file=version.txt,line=0,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.txt' file before tagging." exit 1 fi @@ -116,33 +116,13 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@66535aaf56f831b35e3a8481c9c99b665b84dd45 # v3.4.2 + uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2 with: cache-read-only: false - name: Compile SDK & Javadoc - run: ./gradlew assemble :sdk:javadoc -Dfile.encoding=UTF-8 --scan + run: ./gradlew assemble :sdk:javadoc --scan - name: Nexus Release if: ${{ github.event_name == 'push' }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} - - - name: Nexus Release (workflow_dispatch) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: ./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} - - - name: Nexus Release sdk-full artifacts - if: ${{ github.event_name == 'push' }} - run: | - # This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged - sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle - git clean -fdx - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} - - - name: Nexus Release sdk-full artifacts (workflow_dispatch) - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - # This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged - sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle - git clean -fdx - ./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + run: ./gradlew closeAndReleaseSonatypeStagingRepository --no-configuration-cache --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 520bec1a7a..0000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -image: gradle:6.6-jdk14 - -variables: - GRADLE_OPTS: "-Dorg.gradle.daemon=false" - -before_script: - - export GRADLE_USER_HOME=`pwd`/.gradle - -stages: - - build - -build: - stage: build - script: gradle --build-cache assemble - cache: - key: "$CI_COMMIT_REF_NAME" - policy: push - paths: - - build - - .gradle diff --git a/Taskfile.yml b/Taskfile.yml index 9a41c647e9..a6b43e0f1f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -32,7 +32,7 @@ tasks: "test:integration": cmds: - - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK integrationTest {{.CLI_ARGS}} + - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK testIntegration {{.CLI_ARGS}} env: OPERATOR_KEY: '0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4' OPERATOR_ID: '0.0.1022' @@ -79,16 +79,3 @@ tasks: - task: "update:proto" - task: "update:snapshots" - task: "update:addressbooks" - - publish: - env: - FILES: "sdk/src/main/java/com/hedera/hashgraph/sdk/*.java" - preconditions: - - git diff-index --quiet HEAD - cmds: - - git clean -ffdx - - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository - - perl -p -i -e "s#sdk\.gradle#sdk-full.gradle#g" sdk/build.gradle - - git clean -ffdx - - ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository - - git restore sdk diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 55d74d53e9..0000000000 --- a/build.gradle +++ /dev/null @@ -1,111 +0,0 @@ -plugins { - id "net.ltgt.errorprone" version "3.1.0" apply false - - // Gradle plugin to discover dependency updates - // - id "com.github.ben-manes.versions" version "0.48.0" - - id "jacoco" - id "org.sonarqube" version "4.3.1.3277" - - id "io.github.gradle-nexus.publish-plugin" version "1.3.0" -} - -apply from: "./version.gradle" - -allprojects { - apply plugin: "java" - apply plugin: "net.ltgt.errorprone" - - sourceCompatibility = 17 - targetCompatibility = 17 - - repositories { - mavenCentral() - maven { url 'https://jitpack.io' } - } - - dependencies { - // https://github.com/google/error-prone - // https://errorprone.info/ - errorprone "com.google.errorprone:error_prone_core:2.21.1" - - // https://github.com/uber/NullAway - errorprone "com.uber.nullaway:nullaway:0.10.14" - - // https://github.com/grpc/grpc-java-api-checker - errorprone "io.grpc:grpc-java-api-checker:1.1.0" - } - - jacoco { - toolVersion = "0.8.8" - } - - sonarqube { - properties { - property "sonar.projectKey", "hashgraph_hedera-sdk-java" - property "sonar.organization", "hashgraph" - property "sonar.host.url", "https://sonarcloud.io" - property "sonar.exclusions", "examples/**" - } - } - - tasks.withType(Test) { - apply plugin: "jacoco" - } - - tasks.withType(JavaCompile).configureEach { - options.encoding = "UTF-8" - - // Disable warnings because I'm tired of them :P - options.warnings = false - - options.errorprone { - // https://github.com/uber/NullAway - warn("NullAway") - option("NullAway:AnnotatedPackages", "com.hedera.hashgraph.sdk") - option("NullAway:TreatGeneratedAsUnannotated", "true") - - // https://github.com/grpc/grpc-java-api-checker - disable("GrpcExperimentalApi") - warn("GrpcInternal") - - // Enable _all_ error prone checks then selectively disble - // Checks that are default-disabled are enabled as warnings - allDisabledChecksAsWarnings = true - disable("TryFailRefactoring") - disable("ThrowSpecificExceptions") - disable("FutureReturnValueIgnored") - disable("FieldCanBeFinal") - disable("Finally") - disable("BooleanParameter") - disable("ThreadJoinLoop") - disable("UnnecessaryDefaultInEnumSwitch") - disable("UngroupedOverloads") - disable("InlineMeSuggester") - - // Uncomment do disable Android + JDK7 checks - // disable("Java7ApiChecker") - // disable("AndroidJdkLibsChecker") - - // Ignore generated and protobuf code - disableWarningsInGeneratedCode = true - excludedPaths = ".*generated.*" - } - } -} - -nexusPublishing { - repositories { - sonatype { - } - } -} - -tasks.register("showVersion") { - group = "versioning" - inputs.property("version", project.version) - doLast { - println(inputs.properties["version"]) - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..485c3138a1 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("com.hedera.gradle.root") +} + +dependencyAnalysis.abi { + exclusions { + // Exposes: org.slf4j.Logger + excludeClasses("logger") + // Exposes: com.google.common.base.MoreObjects.ToStringHelper + excludeClasses(".*\\.CustomFee") + // Exposes: com.esaulpaugh.headlong.abi.Tuple + excludeClasses(".*\\.ContractFunctionResult") + // Exposes: org.bouncycastle.crypto.params.KeyParameter + excludeClasses(".*\\.PrivateKey.*") + // Exposes: io.grpc.stub.AbstractFutureStub (and others) + excludeClasses(".*Grpc") + } +} diff --git a/docs/android-app/android-app-quickstart.md b/docs/android-app/android-app-quickstart.md index 84ca827497..b967ed2c0e 100644 --- a/docs/android-app/android-app-quickstart.md +++ b/docs/android-app/android-app-quickstart.md @@ -11,8 +11,8 @@ implementation 'com.hedera.hashgraph:sdk:2.29.0' 2. **gRPC implementation:** ```groovy -// okhttp transport (for lighter-weight applications or Android) -implementation 'io.grpc:grpc-okhttp:1.58.0' +// okhttp transport (for lighter-weight applications or Android +runtimeOnly("io.grpc:grpc-okhttp") ``` ## Next steps diff --git a/docs/java-app/java-app-quickstart.md b/docs/java-app/java-app-quickstart.md index f8932dab6a..feb2a156c3 100644 --- a/docs/java-app/java-app-quickstart.md +++ b/docs/java-app/java-app-quickstart.md @@ -25,15 +25,15 @@ _Maven:_ _Gradle:_ ```groovy // netty transport (for high throughput applications) -implementation 'io.grpc:grpc-netty-shaded:1.57.2' +implementation 'io.grpc:grpc-netty-shaded' ``` ```groovy // netty transport, unshaded (if you have a matching Netty dependency already) -implementation 'io.grpc:grpc-netty:1.57.2' +implementation 'io.grpc:grpc-netty' ``` ```groovy // okhttp transport (for lighter-weight applications or Android) -implementation 'io.grpc:grpc-okhttp:1.57.2' +implementation 'io.grpc:grpc-okhttp' ``` _Maven:_ @@ -42,7 +42,7 @@ _Maven:_ io.grpc grpc-netty-shaded - 1.57.2 + 1.64.0 ``` ```xml @@ -50,7 +50,7 @@ _Maven:_ io.grpc grpc-netty - 1.57.2 + 1.64.0 ``` ```xml @@ -58,7 +58,7 @@ _Maven:_ io.grpc grpc-okhttp - 1.57.2 + 1.64.0 ``` diff --git a/docs/sdk/developer-guide.md b/docs/sdk/developer-guide.md index 8e3fc96fcb..3367ad9b08 100644 --- a/docs/sdk/developer-guide.md +++ b/docs/sdk/developer-guide.md @@ -7,7 +7,7 @@ JDK 17 is required. The Temurin builds of [Eclipse Adoptium](https://adoptium.ne ### Building ```sh -./gradlew compileJava +./gradlew assemble ``` ### Unit Tests @@ -18,24 +18,21 @@ JDK 17 is required. The Temurin builds of [Eclipse Adoptium](https://adoptium.ne ### Integration Tests -> The tests are only executed if the configuration is provided -> as an environment variable (see the `onlyIf` block in [`sdk/build.gradle`](../../sdk/build.gradle)). +> The tests are only executed if the configuration is provided. > That's why we need to pass the configuration file at the beginning of the command. -> **The `CONFIG_FILE` environment variable is not used, so you can provide any value, -> but it should not be `null`.** -#### Using system properties -`OPERATOR_ID`, `OPERATOR_KEY` and `HEDERA_NETWORK` must be passed into system properties.\ +#### Using Gradle properties +`OPERATOR_ID`, `OPERATOR_KEY` and `HEDERA_NETWORK` must be passed as Gradle properties (`-P` parameters).\ `HEDERA_NETWORK` can be set to `localhost`, `testnet` or `previewnet`. ```sh -CONFIG_FILE=whatever ./gradlew integrationTest -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="" +./gradlew testIntegration -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="" ``` #### Using configuration file ```sh -CONFIG_FILE=whatever ./gradlew integrationTest -PCONFIG_FILE="" +./gradlew testIntegration -PCONFIG_FILE="" ``` An example configuration file can be found in the repo here: @@ -79,18 +76,17 @@ The format of the configuration file should be as follows: Running test class: ```sh -CONFIG_FILE=whatever ./gradlew integrationTest -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="testnet" --tests "" +./gradlew testIntegration -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="testnet" --tests "" ``` Running test function: ```sh -CONFIG_FILE=whatever ./gradlew integrationTest -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="testnet" --tests "" +./gradlew testIntegration -POPERATOR_ID="" -POPERATOR_KEY="" -PHEDERA_NETWORK="testnet" --tests "" ``` #### Running with Intellij IDEA 1. Create a new Gradle run configuration (easiest way is to run test class or individual test function from the IDE). -2. Update "Run" configuration to pass the required system properties (`OPERATOR_ID`, `OPERATOR_KEY` and `HEDERA_NETWORK`). -3. Update "Environment variables" to pass the `CONFIG_FILE=whatever`. +2. Update "Run" configuration to pass the required Gradle properties (`OPERATOR_ID`, `OPERATOR_KEY` and `HEDERA_NETWORK`). ## Maintaining generated files diff --git a/example-android/README.md b/example-android/README.md index fe39699980..897800ddb2 100644 --- a/example-android/README.md +++ b/example-android/README.md @@ -10,7 +10,7 @@ the "Generate" button. - **Account Balance tab** allows you to retrieve the balance of an account by pressing the "Get Account Balance" button and specifying the desired account, which can be different from the default account specified in the - [`app/src/main/res/values/strings.xml`](../example-android/app/src/main/res/values/strings.xml) file. + [`app/src/main/res/values/strings.xml`](app/src/main/res/values/strings.xml) file. - **Crypto Transfer tab** allows you to transfer a specified amount of HBARs from your account to a recipient account by pressing the "Send HBAR" button and setting the recipient's account in the provided text field. @@ -20,31 +20,23 @@ and setting the recipient's account in the provided text field. ### Configuration Running the example requires `operator_id` and `operator_key` resource strings to be set in -[`app/src/main/res/values/strings.xml`](../example-android/app/src/main/res/values/strings.xml). +[`app/src/main/res/values/strings.xml`](app/src/main/res/values/strings.xml). ```xml ... ... ``` -### Running with a local SDK version -By default, the example uses the SDK version published on Maven Central. -If you want to use the local version, follow the steps below: -- Publish the SDK to the local Maven repo - `./gradlew :sdk:publishToMavenLocal` -- Uncomment the `mavenLocal()` line in `example-android/build.gradle` -- Build the example - `./gradlew :example-android:build --refresh-dependencies` -- Run the example - -> Note that the above `./gradlew` commands should be run from the root of the project. - -> If you get the following error: -> `Cannot perform signing task ':sdk:signMavenJavaPublication' because it has no configured signatory` -> , then you should be able to resolve the error by providing the expected GPG variables in -> the `gradle.properties` file in your `HOME` directory: - -```properties -# File location: ~/.gradle/gradle.properties - see https://docs.gradle.org/current/userguide/directory_layout.html -signing.keyId=248... -signing.password=sec... -signing.secretKeyRingFile=/Users/me/... +You can then build and install the application on a connected device or emulator: + +``` +./gradlew installDebug ``` + +## Running with local vs published SDK version + +The example uses the local SDK version. If you want to use the example stand-alone with an SDK version published to +Maven Central you need to remove the line `includeBuild("..")` from [settings.gradle.kts](settings.gradle.kts) +and `implementation(platform("com.hedera.hashgraph:sdk-dependency-versions"))` from +[app/build.gradle.kts](app/build.gradle.kts). You can define the version of the SDK you would like to use by modifying +the `implementation("com.hedera.hashgraph:sdk:")` dependency in [app/build.gradle.kts](app/build.gradle.kts). diff --git a/example-android/app/build.gradle b/example-android/app/build.gradle deleted file mode 100644 index 2a7b5d0a38..0000000000 --- a/example-android/app/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" -} - -android { - compileSdkVersion 33 - - defaultConfig { - applicationId "com.hedera.android_example" - minSdkVersion 26 - targetSdkVersion 33 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = "1.8" - } - - namespace 'com.hedera.android_example' -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.9.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation "androidx.core:core-ktx:1.10.1" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1" - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - - implementation 'com.hedera.hashgraph:sdk:2.34.0' - - implementation 'org.slf4j:slf4j-simple:2.0.7' - implementation 'io.grpc:grpc-okhttp:1.49.2' - - implementation "io.grpc:grpc-protobuf-lite:1.50.2" - - // Protobuf Lite is used to maintain easy compatibility with Android - // https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md - implementation "com.google.protobuf:protobuf-javalite:3.21.9" -} - -repositories { - mavenCentral() -} diff --git a/example-android/app/build.gradle.kts b/example-android/app/build.gradle.kts new file mode 100644 index 0000000000..47a1113f80 --- /dev/null +++ b/example-android/app/build.gradle.kts @@ -0,0 +1,65 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +repositories { + google() + mavenCentral() +} + +android { + compileSdk = 34 + namespace = "com.hedera.android_example" + + defaultConfig { + applicationId = "com.hedera.android_example" + minSdk = 26 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles.add(getDefaultProguardFile("proguard-android-optimize.txt")) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + // --- Remove to use a published SDK version --- + implementation(platform("com.hedera.hashgraph:sdk-dependency-versions")) + // --------------------------------------------- + + implementation("com.hedera.hashgraph:sdk:2.34.0") + + implementation("com.google.android.material:material:1.11.0") + + implementation("androidx.appcompat:appcompat") + implementation("androidx.constraintlayout:constraintlayout") + implementation("androidx.coordinatorlayout:coordinatorlayout") + implementation("androidx.fragment:fragment") + implementation("androidx.lifecycle:lifecycle-common") + implementation("androidx.lifecycle:lifecycle-viewmodel") + implementation("androidx.recyclerview:recyclerview") + implementation("androidx.viewpager2:viewpager2") + + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") + + runtimeOnly("io.grpc:grpc-okhttp") + runtimeOnly("org.slf4j:slf4j-simple:2.0.12") +} diff --git a/example-android/build.gradle b/example-android/build.gradle deleted file mode 100644 index c314d7b3c0..0000000000 --- a/example-android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '1.9.10' - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.quittle:android-emulator-plugin:0.4.5' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - // Uncomment if you want to use the local SDK version - // mavenLocal() - google() - // hashgraph SDK is published to Maven Central only - mavenCentral() - } -} diff --git a/example-android/build.gradle.kts b/example-android/build.gradle.kts new file mode 100644 index 0000000000..38b74eeb4f --- /dev/null +++ b/example-android/build.gradle.kts @@ -0,0 +1,5 @@ +plugins { + id("com.android.application") version "8.2.2" apply false + id("org.jetbrains.kotlin.android") version "1.9.22" apply false + id("com.autonomousapps.dependency-analysis") version "1.30.0" +} diff --git a/example-android/gradle.properties b/example-android/gradle.properties index f2fe308911..ddbf0cf644 100644 --- a/example-android/gradle.properties +++ b/example-android/gradle.properties @@ -1,2 +1,2 @@ android.useAndroidX=true -org.gradle.jvmargs=-Xmx8g +org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8 diff --git a/example-android/gradle/wrapper/gradle-wrapper.jar b/example-android/gradle/wrapper/gradle-wrapper.jar index d64cd49177..e6441136f3 100644 Binary files a/example-android/gradle/wrapper/gradle-wrapper.jar and b/example-android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example-android/gradle/wrapper/gradle-wrapper.properties b/example-android/gradle/wrapper/gradle-wrapper.properties index 1af9e0930b..a4413138c9 100644 --- a/example-android/gradle/wrapper/gradle-wrapper.properties +++ b/example-android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/example-android/gradlew b/example-android/gradlew index 1aa94a4269..b740cf1339 100755 --- a/example-android/gradlew +++ b/example-android/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/example-android/gradlew.bat b/example-android/gradlew.bat index 6689b85bee..7101f8e467 100644 --- a/example-android/gradlew.bat +++ b/example-android/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/example-android/settings.gradle b/example-android/settings.gradle deleted file mode 100644 index 6b1029f43e..0000000000 --- a/example-android/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name='Android Example' -include ':app' diff --git a/example-android/settings.gradle.kts b/example-android/settings.gradle.kts new file mode 100644 index 0000000000..b35a0c1f5d --- /dev/null +++ b/example-android/settings.gradle.kts @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +// --- Remove to use a published SDK version --- +includeBuild("..") +// --------------------------------------------- + +rootProject.name = "Android Example" + +include("app") diff --git a/examples/README.md b/examples/README.md index f792f772ac..b722f53853 100644 --- a/examples/README.md +++ b/examples/README.md @@ -74,10 +74,10 @@ ## Usage ### Configuration -Running the examples requires `.env` file to exist under [`root project folder`](../): +Running the examples requires `.env` file to exist in the [`examples`](.) folder: ```sh -cp .env.sample ../.env +cp .env.sample .env ``` The `OPERATOR_ID` and `OPERATOR_KEY` variables should be set in a `.env` file. @@ -99,13 +99,13 @@ HEDERA_NETWORK=previewnet Template: ```sh -./gradlew -q example:run +./gradlew -q :examples:run ``` Concrete example: ```sh -./gradlew -q example:runGenerateKey +./gradlew -q :examples:runGenerateKey ``` ### Running with Intellij diff --git a/examples/build.gradle b/examples/build.gradle deleted file mode 100644 index 9309f5a9a0..0000000000 --- a/examples/build.gradle +++ /dev/null @@ -1,64 +0,0 @@ -dependencies { - implementation project(":sdk") - - implementation "com.google.code.gson:gson:2.10.1" - implementation "org.slf4j:slf4j-simple:2.0.9" - implementation "io.grpc:grpc-netty-shaded:1.57.2" - implementation "io.github.cdimascio:java-dotenv:5.3.1" - implementation "com.google.errorprone:error_prone_core:2.21.1" -} - -task runAllExamples { - def exampleClasses = fileTree('src/main/java') - .toList() - .stream() - .filter { it.name.endsWith('Example.java') } - .map { it.name.replaceAll('\\.java$', '') } - .filter { !it.equals('ValidateChecksumExample') } // disabled this example, because it needs user input (but it WORKS) - .filter { !it.equals('ZeroTokenOperationsExample') } // doesn't work - .filter { !it.equals('SolidityPrecompileExample') } // doesn't work with hedera-local-node - .filter { !it.equals('ConsensusPubSubChunkedExample') } // doesn't work on CI - .toList() - - exampleClasses.each { className -> - def multilineString = """ - - ---EXECUTING $className: - - """ - - doLast { - javaexec { - println multilineString - - classpath = sourceSets.main.runtimeClasspath - main = className - standardInput(System.in) - - // NOTE: Uncomment to enable trace logs in the SDK during the examples - // jvmArgs "-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace" - } - } - } - -} - -tasks.addRule("Pattern: run: Runs an example.") { String taskName -> - if (taskName.startsWith("run")) { - task(taskName, type: JavaExec) { - classpath = sourceSets.main.runtimeClasspath - main = (taskName - "run") + "Example" - standardInput(System.in) - - // NOTE: Uncomment to enable trace logs in the SDK during the examples - // jvmArgs "-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace" - } - } -} - -tasks.withType(JavaCompile).configureEach { - options.errorprone { - disable("DefaultPackage") - disable("SystemOut") - } -} diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts new file mode 100644 index 0000000000..21e55d216c --- /dev/null +++ b/examples/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("com.hedera.gradle.examples.java") +} + +mainModuleInfo { + runtimeOnly("io.grpc.netty.shaded") + runtimeOnly("org.slf4j.simple") +} + +dependencies.constraints { + implementation("com.hedera.hashgraph:sdk:2.34.0") + implementation("com.hedera.hashgraph:sdk-full:2.34.0") +} diff --git a/examples/settings.gradle.kts b/examples/settings.gradle.kts new file mode 100644 index 0000000000..688356136e --- /dev/null +++ b/examples/settings.gradle.kts @@ -0,0 +1,10 @@ +pluginManagement { + includeBuild("../gradle/plugins") + repositories { + gradlePluginPortal() + } +} + +// --- Remove to use a published SDK version --- +includeBuild("..") +// --------------------------------------------- diff --git a/examples/src/main/java/AccountAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java similarity index 99% rename from examples/src/main/java/AccountAliasExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java index 4191c19e9f..a5e5b078d5 100644 --- a/examples/src/main/java/AccountAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalance; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/AccountAllowanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java similarity index 98% rename from examples/src/main/java/AccountAllowanceExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java index 79ec36e0a1..9710d7fc33 100644 --- a/examples/src/main/java/AccountAllowanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -import com.hedera.hashgraph.sdk.AccountAllowanceAdjustTransaction; + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountAllowanceDeleteTransaction; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.AccountInfoQuery; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/examples/src/main/java/AccountCreateWithHtsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java similarity index 99% rename from examples/src/main/java/AccountCreateWithHtsExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java index 67c3192bd6..45916302a6 100644 --- a/examples/src/main/java/AccountCreateWithHtsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java @@ -18,11 +18,12 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; import java.util.*; -import java.util.concurrent.TimeoutException; public final class AccountCreateWithHtsExample { diff --git a/examples/src/main/java/AccountCreationWaysExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreationWaysExample.java similarity index 98% rename from examples/src/main/java/AccountCreationWaysExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreationWaysExample.java index 423b4d2f07..7ff3f67381 100644 --- a/examples/src/main/java/AccountCreationWaysExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreationWaysExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; public class AccountCreationWaysExample { diff --git a/examples/src/main/java/AutoCreateAccountTransferTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java similarity index 99% rename from examples/src/main/java/AutoCreateAccountTransferTransactionExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java index 0514bc0b39..63aedd76d5 100644 --- a/examples/src/main/java/AutoCreateAccountTransferTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; diff --git a/examples/src/main/java/ChangeRemoveTokenKeys.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java similarity index 99% rename from examples/src/main/java/ChangeRemoveTokenKeys.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java index 7004ba744f..ca69233c66 100644 --- a/examples/src/main/java/ChangeRemoveTokenKeys.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.KeyList; diff --git a/examples/src/main/java/ClientHelper.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java similarity index 96% rename from examples/src/main/java/ClientHelper.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java index b776c7e299..1c4ccfe143 100644 --- a/examples/src/main/java/ClientHelper.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import java.util.HashMap; diff --git a/examples/src/main/java/ConsensusPubSubChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java similarity index 97% rename from examples/src/main/java/ConsensusPubSubChunkedExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java index 7129bc8530..b1dd3df511 100644 --- a/examples/src/main/java/ConsensusPubSubChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.AccountId; @@ -127,8 +130,7 @@ public static void main(String[] args) throws TimeoutException, PrecheckStatusEx } private static String readResources(String filename) { - ClassLoader classLoader = ConsensusPubSubChunkedExample.class.getClassLoader(); - InputStream inputStream = classLoader.getResourceAsStream(filename); + InputStream inputStream = ConsensusPubSubChunkedExample.class.getResourceAsStream(filename); StringBuilder bigContents = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(inputStream), UTF_8))) { @Var String line; diff --git a/examples/src/main/java/ConsensusPubSubExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java similarity index 98% rename from examples/src/main/java/ConsensusPubSubExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java index 9403fa898d..430d999de0 100644 --- a/examples/src/main/java/ConsensusPubSubExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/examples/src/main/java/ConsensusPubSubWithSubmitKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java similarity index 99% rename from examples/src/main/java/ConsensusPubSubWithSubmitKeyExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java index 3e99b4c0b5..cc63534a07 100644 --- a/examples/src/main/java/ConsensusPubSubWithSubmitKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/examples/src/main/java/ConstructClientExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConstructClientExample.java similarity index 99% rename from examples/src/main/java/ConstructClientExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConstructClientExample.java index 2aaacad4dc..194ee84514 100644 --- a/examples/src/main/java/ConstructClientExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConstructClientExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.NetworkName; diff --git a/examples/src/main/java/ContractHelper.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java similarity index 97% rename from examples/src/main/java/ContractHelper.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java index af8a31eae8..77e3fa6078 100644 --- a/examples/src/main/java/ContractHelper.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.google.gson.Gson; import com.google.gson.JsonObject; import com.hedera.hashgraph.sdk.AccountId; @@ -14,8 +16,6 @@ import com.hedera.hashgraph.sdk.Status; import com.hedera.hashgraph.sdk.TransactionId; import com.hedera.hashgraph.sdk.TransactionRecord; -import com.hedera.hashgraph.sdk.TransactionRecordQuery; -import com.hedera.hashgraph.sdk.TransactionResponse; import java.io.IOException; import java.io.InputStream; @@ -59,7 +59,7 @@ public class ContractHelper { final Map stepFeePayers = new HashMap<>(); public static String getBytecodeHex(String filename) throws IOException { - try (InputStream jsonStream = ContractHelper.class.getClassLoader().getResourceAsStream(filename)) { + try (InputStream jsonStream = ContractHelper.class.getResourceAsStream(filename)) { if (jsonStream == null) { throw new RuntimeException("failed to get " + filename); } diff --git a/examples/src/main/java/ContractNoncesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java similarity index 99% rename from examples/src/main/java/ContractNoncesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java index a7b12d0cc7..c438317288 100644 --- a/examples/src/main/java/ContractNoncesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.ContractCreateTransaction; @@ -36,7 +38,6 @@ import io.github.cdimascio.dotenv.Dotenv; import java.util.List; import java.util.Objects; -import java.util.concurrent.TimeoutException; public final class ContractNoncesExample { diff --git a/examples/src/main/java/CreateAccountExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java similarity index 98% rename from examples/src/main/java/CreateAccountExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java index fe88c195a9..7556666a3d 100644 --- a/examples/src/main/java/CreateAccountExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/examples/src/main/java/CreateAccountThresholdKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java similarity index 99% rename from examples/src/main/java/CreateAccountThresholdKeyExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java index cbddfef452..c0fe422abe 100644 --- a/examples/src/main/java/CreateAccountThresholdKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java similarity index 98% rename from examples/src/main/java/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java index 4916faa865..8c89238e1f 100644 --- a/examples/src/main/java/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java @@ -1,8 +1,9 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; -import java.util.concurrent.TimeoutException; public class CreateAccountWithAliasAndReceiverSignatureRequiredExample { // see `.env.sample` in the repository root for how to specify these values diff --git a/examples/src/main/java/CreateAccountWithAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java similarity index 98% rename from examples/src/main/java/CreateAccountWithAliasExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java index e4e49def19..740367cac2 100644 --- a/examples/src/main/java/CreateAccountWithAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java @@ -1,8 +1,9 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; -import java.util.concurrent.TimeoutException; public class CreateAccountWithAliasExample { // see `.env.sample` in the repository root for how to specify these values diff --git a/examples/src/main/java/CreateFileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java similarity index 98% rename from examples/src/main/java/CreateFileExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java index 3fbd39f0d0..7444e7a03c 100644 --- a/examples/src/main/java/CreateFileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileCreateTransaction; diff --git a/examples/src/main/java/CreateSimpleContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java similarity index 94% rename from examples/src/main/java/CreateSimpleContractExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java index 1e038be246..89599302ee 100644 --- a/examples/src/main/java/CreateSimpleContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java @@ -17,8 +17,9 @@ * limitations under the License. * */ -import com.google.gson.Gson; -import com.google.gson.JsonObject; + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.ContractCallQuery; @@ -29,20 +30,14 @@ import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileId; import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; import com.hedera.hashgraph.sdk.Status; import com.hedera.hashgraph.sdk.TransactionReceipt; import com.hedera.hashgraph.sdk.TransactionResponse; import io.github.cdimascio.dotenv.Dotenv; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Objects; -import java.util.concurrent.TimeoutException; public final class CreateSimpleContractExample { diff --git a/examples/src/main/java/CreateStatefulContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java similarity index 93% rename from examples/src/main/java/CreateStatefulContractExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java index 72cdcd0a8b..698b2841c5 100644 --- a/examples/src/main/java/CreateStatefulContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java @@ -17,8 +17,9 @@ * limitations under the License. * */ -import com.google.gson.Gson; -import com.google.gson.JsonObject; + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.ContractCallQuery; @@ -30,19 +31,12 @@ import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileId; import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; import com.hedera.hashgraph.sdk.TransactionReceipt; import com.hedera.hashgraph.sdk.TransactionResponse; import io.github.cdimascio.dotenv.Dotenv; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; import java.util.Objects; -import java.util.concurrent.TimeoutException; public final class CreateStatefulContractExample { diff --git a/examples/src/main/java/CreateTopicExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java similarity index 98% rename from examples/src/main/java/CreateTopicExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java index 44267356e8..e20fcba5a4 100644 --- a/examples/src/main/java/CreateTopicExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/examples/src/main/java/CustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java similarity index 99% rename from examples/src/main/java/CustomFeesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java index ce7d6ec971..5033833d7d 100644 --- a/examples/src/main/java/CustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; diff --git a/examples/src/main/java/DeleteAccountExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteAccountExample.java similarity index 98% rename from examples/src/main/java/DeleteAccountExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteAccountExample.java index ea8e5ecafe..c660246ecc 100644 --- a/examples/src/main/java/DeleteAccountExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteAccountExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/DeleteFileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteFileExample.java similarity index 98% rename from examples/src/main/java/DeleteFileExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteFileExample.java index d0a379db37..2f00ab9c1b 100644 --- a/examples/src/main/java/DeleteFileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteFileExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileCreateTransaction; diff --git a/examples/src/main/java/ExemptCustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java similarity index 99% rename from examples/src/main/java/ExemptCustomFeesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java index 17d99728a1..49e035b7ac 100644 --- a/examples/src/main/java/ExemptCustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/FileAppendChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java similarity index 98% rename from examples/src/main/java/FileAppendChunkedExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java index 98f15c083c..71fbe6377b 100644 --- a/examples/src/main/java/FileAppendChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileAppendTransaction; diff --git a/examples/src/main/java/GenerateKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyExample.java similarity index 96% rename from examples/src/main/java/GenerateKeyExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyExample.java index 5f383dcbff..87024b2ca5 100644 --- a/examples/src/main/java/GenerateKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; diff --git a/examples/src/main/java/GenerateKeyWithMnemonicExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyWithMnemonicExample.java similarity index 96% rename from examples/src/main/java/GenerateKeyWithMnemonicExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyWithMnemonicExample.java index f99aa8a11d..933b085ecd 100644 --- a/examples/src/main/java/GenerateKeyWithMnemonicExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyWithMnemonicExample.java @@ -17,7 +17,9 @@ * limitations under the License. * */ -import com.hedera.hashgraph.sdk.BadMnemonicException; + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.Mnemonic; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; diff --git a/examples/src/main/java/GetAccountBalanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java similarity index 97% rename from examples/src/main/java/GetAccountBalanceExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java index 17a7243115..62f69fdc5f 100644 --- a/examples/src/main/java/GetAccountBalanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/examples/src/main/java/GetAccountInfoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java similarity index 98% rename from examples/src/main/java/GetAccountInfoExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java index 7d2ea163e4..6b0b374ace 100644 --- a/examples/src/main/java/GetAccountInfoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.AccountInfo; import com.hedera.hashgraph.sdk.AccountInfoQuery; diff --git a/examples/src/main/java/GetAddressBookExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java similarity index 97% rename from examples/src/main/java/GetAddressBookExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java index 2c0af5f0b3..a21974b682 100644 --- a/examples/src/main/java/GetAddressBookExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AddressBookQuery; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileId; @@ -27,8 +30,6 @@ import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files; -import java.util.Collections; -import java.util.List; /** * Get the network address book for inspecting the node public keys, among other things diff --git a/examples/src/main/java/GetExchangeRatesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java similarity index 98% rename from examples/src/main/java/GetExchangeRatesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java index 956a614308..e749de42ec 100644 --- a/examples/src/main/java/GetExchangeRatesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/GetFileContentsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java similarity index 98% rename from examples/src/main/java/GetFileContentsExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java index 487e66763c..90f5c747bd 100644 --- a/examples/src/main/java/GetFileContentsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/examples/src/main/java/LoggerFunctionalitiesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java similarity index 98% rename from examples/src/main/java/LoggerFunctionalitiesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java index 658f22f03f..afcb60a07f 100644 --- a/examples/src/main/java/LoggerFunctionalitiesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import com.hedera.hashgraph.sdk.logger.LogLevel; import com.hedera.hashgraph.sdk.logger.Logger; diff --git a/examples/src/main/java/MultiAppTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java similarity index 99% rename from examples/src/main/java/MultiAppTransferExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java index 072ea95e5a..7775030f2c 100644 --- a/examples/src/main/java/MultiAppTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/examples/src/main/java/MultiSigOfflineExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java similarity index 99% rename from examples/src/main/java/MultiSigOfflineExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java index ca1b2e7ddf..7aa9280d0c 100644 --- a/examples/src/main/java/MultiSigOfflineExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/examples/src/main/java/NftAddRemoveAllowancesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java similarity index 99% rename from examples/src/main/java/NftAddRemoveAllowancesExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java index 5a9d6f0f73..de9050646f 100644 --- a/examples/src/main/java/NftAddRemoveAllowancesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/PrngExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java similarity index 98% rename from examples/src/main/java/PrngExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java index 76461689d8..18a080a521 100644 --- a/examples/src/main/java/PrngExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; diff --git a/examples/src/main/java/ScheduleExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java similarity index 99% rename from examples/src/main/java/ScheduleExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java index 75342ddd8e..fe7fd8a268 100644 --- a/examples/src/main/java/ScheduleExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import java.time.Instant; diff --git a/examples/src/main/java/ScheduleIdenticalTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java similarity index 98% rename from examples/src/main/java/ScheduleIdenticalTransactionExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java index 537aa98d79..d46768367f 100644 --- a/examples/src/main/java/ScheduleIdenticalTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java @@ -17,17 +17,18 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.AccountId; +import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; import com.hedera.hashgraph.sdk.ScheduleCreateTransaction; import com.hedera.hashgraph.sdk.ScheduleId; import com.hedera.hashgraph.sdk.ScheduleInfoQuery; @@ -41,7 +42,6 @@ import java.util.Collections; import java.util.Objects; -import java.util.concurrent.TimeoutException; public class ScheduleIdenticalTransactionExample { diff --git a/examples/src/main/java/ScheduleMultiSigTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java similarity index 99% rename from examples/src/main/java/ScheduleMultiSigTransactionExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java index 70aca2753b..923926adf3 100644 --- a/examples/src/main/java/ScheduleMultiSigTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/ScheduledTransactionMultiSigThresholdExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java similarity index 99% rename from examples/src/main/java/ScheduledTransactionMultiSigThresholdExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java index 34a980e962..3b71c65dd6 100644 --- a/examples/src/main/java/ScheduledTransactionMultiSigThresholdExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalance; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/examples/src/main/java/ScheduledTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java similarity index 98% rename from examples/src/main/java/ScheduledTransferExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java index 645501db5d..0bba3c2ff8 100644 --- a/examples/src/main/java/ScheduledTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalance; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; @@ -24,9 +27,7 @@ import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; import com.hedera.hashgraph.sdk.ScheduleCreateTransaction; import com.hedera.hashgraph.sdk.ScheduleId; import com.hedera.hashgraph.sdk.ScheduleInfo; @@ -37,7 +38,6 @@ import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; -import java.util.concurrent.TimeoutException; public final class ScheduledTransferExample { diff --git a/examples/src/main/java/SignTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java similarity index 98% rename from examples/src/main/java/SignTransactionExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java index 0dea8fc353..834a894b47 100644 --- a/examples/src/main/java/SignTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/SolidityPrecompileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java similarity index 96% rename from examples/src/main/java/SolidityPrecompileExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java index da7c152f96..eaed1b7571 100644 --- a/examples/src/main/java/SolidityPrecompileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java @@ -1,18 +1,16 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.ContractFunctionParameters; import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; import io.github.cdimascio.dotenv.Dotenv; -import java.io.IOException; import java.util.Arrays; import java.util.Objects; -import java.util.concurrent.TimeoutException; /* This example just instantiates the solidity contract diff --git a/examples/src/main/java/StakingExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java similarity index 98% rename from examples/src/main/java/StakingExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java index c6e7825e4b..d1246d18fc 100644 --- a/examples/src/main/java/StakingExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.AccountInfo; diff --git a/examples/src/main/java/StakingWithUpdateExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java similarity index 99% rename from examples/src/main/java/StakingWithUpdateExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java index 9023052e60..ee5e778a53 100644 --- a/examples/src/main/java/StakingWithUpdateExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.AccountInfo; diff --git a/examples/src/main/java/TokenMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java similarity index 99% rename from examples/src/main/java/TokenMetadataExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java index 408183d4fc..0abbca5a91 100644 --- a/examples/src/main/java/TokenMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrivateKey; diff --git a/examples/src/main/java/TopicWithAdminKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java similarity index 99% rename from examples/src/main/java/TopicWithAdminKeyExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java index 67a703f4ab..3c68e5c025 100644 --- a/examples/src/main/java/TopicWithAdminKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.KeyList; diff --git a/examples/src/main/java/TransactionSerializationExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java similarity index 98% rename from examples/src/main/java/TransactionSerializationExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java index 71018e8f36..dbf63e038c 100644 --- a/examples/src/main/java/TransactionSerializationExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/examples/src/main/java/TransferCryptoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java similarity index 98% rename from examples/src/main/java/TransferCryptoExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java index d6401d01c8..213f3ef6c1 100644 --- a/examples/src/main/java/TransferCryptoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/examples/src/main/java/TransferTokensExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java similarity index 99% rename from examples/src/main/java/TransferTokensExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java index 57602ba24e..89c21c5688 100644 --- a/examples/src/main/java/TransferTokensExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; diff --git a/examples/src/main/java/TransferUsingEvmAddressExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java similarity index 99% rename from examples/src/main/java/TransferUsingEvmAddressExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java index 20d50bf145..6ff527faa6 100644 --- a/examples/src/main/java/TransferUsingEvmAddressExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; diff --git a/examples/src/main/java/UpdateAccountPublicKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java similarity index 98% rename from examples/src/main/java/UpdateAccountPublicKeyExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java index c6e1b6ca7b..cb2f77bbc8 100644 --- a/examples/src/main/java/UpdateAccountPublicKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.AccountInfo; diff --git a/examples/src/main/java/UpdateNftsMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java similarity index 98% rename from examples/src/main/java/UpdateNftsMetadataExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java index b232858875..29c0815e7e 100644 --- a/examples/src/main/java/UpdateNftsMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java @@ -18,12 +18,13 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.NftId; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; import com.hedera.hashgraph.sdk.TokenCreateTransaction; import com.hedera.hashgraph.sdk.TokenId; import com.hedera.hashgraph.sdk.TokenInfoQuery; @@ -34,7 +35,6 @@ import com.hedera.hashgraph.sdk.TransferTransaction; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Objects; diff --git a/examples/src/main/java/ValidateChecksumExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java similarity index 99% rename from examples/src/main/java/ValidateChecksumExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java index 3e30f8f8fe..07a195e605 100644 --- a/examples/src/main/java/ValidateChecksumExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java @@ -17,6 +17,9 @@ * limitations under the License. * */ + +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.AccountBalance; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; diff --git a/examples/src/main/java/ZeroTokenOperationsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java similarity index 99% rename from examples/src/main/java/ZeroTokenOperationsExample.java rename to examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java index a5a22a060c..2d8acfb6da 100644 --- a/examples/src/main/java/ZeroTokenOperationsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java @@ -18,6 +18,8 @@ * */ +package com.hedera.hashgraph.sdk.examples; + import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; diff --git a/examples/src/main/java/module-info.java b/examples/src/main/java/module-info.java new file mode 100644 index 0000000000..e1c78e5dfb --- /dev/null +++ b/examples/src/main/java/module-info.java @@ -0,0 +1,10 @@ +module com.hedera.hashgraph.examples { + requires com.hedera.hashgraph.sdk; + // requires com.hedera.hashgraph.sdk.full; + + requires com.google.gson; + requires java.dotenv; + + requires static com.google.errorprone.annotations; + requires static java.annotation; +} diff --git a/examples/src/main/resources/hello_world.json b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/hello_world.json similarity index 100% rename from examples/src/main/resources/hello_world.json rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/hello_world.json diff --git a/examples/src/main/resources/hello_world.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/hello_world.sol similarity index 100% rename from examples/src/main/resources/hello_world.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/hello_world.sol diff --git a/examples/src/main/resources/large_message.txt b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/large_message.txt similarity index 100% rename from examples/src/main/resources/large_message.txt rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/large_message.txt diff --git a/examples/src/main/resources/precompile-example/ExpiryHelper.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ExpiryHelper.sol similarity index 100% rename from examples/src/main/resources/precompile-example/ExpiryHelper.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ExpiryHelper.sol diff --git a/examples/src/main/resources/precompile-example/FeeHelper.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/FeeHelper.sol similarity index 100% rename from examples/src/main/resources/precompile-example/FeeHelper.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/FeeHelper.sol diff --git a/examples/src/main/resources/precompile-example/HederaResponseCodes.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/HederaResponseCodes.sol similarity index 100% rename from examples/src/main/resources/precompile-example/HederaResponseCodes.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/HederaResponseCodes.sol diff --git a/examples/src/main/resources/precompile-example/HederaTokenService.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/HederaTokenService.sol similarity index 100% rename from examples/src/main/resources/precompile-example/HederaTokenService.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/HederaTokenService.sol diff --git a/examples/src/main/resources/precompile-example/IHederaTokenService.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/IHederaTokenService.sol similarity index 100% rename from examples/src/main/resources/precompile-example/IHederaTokenService.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/IHederaTokenService.sol diff --git a/examples/src/main/resources/precompile-example/IPrngSystemContract.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/IPrngSystemContract.sol similarity index 100% rename from examples/src/main/resources/precompile-example/IPrngSystemContract.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/IPrngSystemContract.sol diff --git a/examples/src/main/resources/precompile-example/KeyHelper.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/KeyHelper.sol similarity index 100% rename from examples/src/main/resources/precompile-example/KeyHelper.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/KeyHelper.sol diff --git a/examples/src/main/resources/precompile-example/PrecompileExample.json b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrecompileExample.json similarity index 100% rename from examples/src/main/resources/precompile-example/PrecompileExample.json rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrecompileExample.json diff --git a/examples/src/main/resources/precompile-example/PrecompileExample.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrecompileExample.sol similarity index 100% rename from examples/src/main/resources/precompile-example/PrecompileExample.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrecompileExample.sol diff --git a/examples/src/main/resources/precompile-example/PrngSystemContract.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrngSystemContract.sol similarity index 100% rename from examples/src/main/resources/precompile-example/PrngSystemContract.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/PrngSystemContract.sol diff --git a/examples/src/main/resources/precompile-example/ZeroTokenOperations.json b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ZeroTokenOperations.json similarity index 100% rename from examples/src/main/resources/precompile-example/ZeroTokenOperations.json rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ZeroTokenOperations.json diff --git a/examples/src/main/resources/precompile-example/ZeroTokenOperations.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ZeroTokenOperations.sol similarity index 100% rename from examples/src/main/resources/precompile-example/ZeroTokenOperations.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/precompile-example/ZeroTokenOperations.sol diff --git a/examples/src/main/resources/stateful.json b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/stateful.json similarity index 100% rename from examples/src/main/resources/stateful.json rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/stateful.json diff --git a/examples/src/main/resources/stateful.sol b/examples/src/main/resources/com/hedera/hashgraph/sdk/examples/stateful.sol similarity index 100% rename from examples/src/main/resources/stateful.sol rename to examples/src/main/resources/com/hedera/hashgraph/sdk/examples/stateful.sol diff --git a/gradle.properties b/gradle.properties index 9a9f27eb9a..1f78a41de0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,9 @@ # Need increased heap for running Gradle itself, or SonarQube will run the JVM out of metaspace -org.gradle.jvmargs=-Xmx6144m +org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8 -# Enable Build Caching +# Enable Build Caching and parallelization (through Configuration Cache) org.gradle.caching=true - -# Enable Gradle parallel builds -org.gradle.parallel=true +org.gradle.configuration-cache=true # Limit parallel workers org.gradle.workers.max=6 diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts new file mode 100644 index 0000000000..f7f884cd51 --- /dev/null +++ b/gradle/plugins/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + `kotlin-dsl` +} + +repositories.gradlePluginPortal() + +dependencies { + implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.32.0") + implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.12") + implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4") + implementation("io.github.gradle-nexus:publish-plugin:1.3.0") + implementation("net.ltgt.gradle:gradle-errorprone-plugin:3.1.0") + implementation("org.gradlex:extra-java-module-info:1.8") + implementation("org.gradlex:java-module-dependencies:1.6.5") + implementation("org.gradlex:jvm-dependency-conflict-resolution:2.1") + implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373") + + implementation("org.gradle.toolchains:foojay-resolver:0.8.0") + implementation("com.gradle:develocity-gradle-plugin:3.17.2") +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.base.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.base.gradle.kts new file mode 100644 index 0000000000..14a9f93039 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.base.gradle.kts @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +group = "com.hedera.hashgraph" +version = providers.fileContents(rootProject.layout.projectDirectory.file("version.txt")).asText.getOrElse("").trim() diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts new file mode 100644 index 0000000000..29f5add515 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import net.ltgt.gradle.errorprone.errorprone + +plugins { + id("application") + id("com.hedera.gradle.java-base") +} + +javaModuleDependencies { + moduleNameToGA.put("com.hedera.hashgraph.sdk", "com.hedera.hashgraph:sdk") + moduleNameToGA.put("com.hedera.hashgraph.sdk.full", "com.hedera.hashgraph:sdk-full") +} + +tasks.withType().configureEach { + options.errorprone { + disable("DefaultPackage") + disable("SystemOut") + } +} + +tasks.register("runAllExamples") { + workingDirectory = rootDir + sources.from(sourceSets.main.get().java.asFileTree) + rtClasspath.from(configurations.runtimeClasspath.get() + files(tasks.jar)) +} + +tasks.addRule("Pattern: run: Runs an example.") { + if (startsWith("run")) { + tasks.register(this) { + workingDir = rootDir + classpath = configurations.runtimeClasspath.get() + files(tasks.jar) + mainModule = "com.hedera.hashgraph.examples" + mainClass = "com.hedera.hashgraph.sdk.examples.${this@addRule.substring("run".length)}Example" + + // NOTE: Uncomment to enable trace logs in the SDK during the examples + // jvmArgs("-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace") + } + } +} + +abstract class RunAllExample : DefaultTask() { + @get:InputFiles + abstract val sources: ConfigurableFileCollection + + @get:InputFiles + abstract val rtClasspath: ConfigurableFileCollection + + @get:Internal + abstract val workingDirectory: RegularFileProperty + + @get:Inject + abstract val exec: ExecOperations + + @TaskAction + fun runAll() { + val exampleClasses = sources + .filter { it.name.endsWith("Example.java") } + .asSequence() + .map { it.name.replace(".java", "") } + .filter { it != "ValidateChecksumExample" } // disabled this example, because it needs user input (but it WORKS) + .filter { it != "ZeroTokenOperationsExample" } // doesn't work + .filter { it != "SolidityPrecompileExample" } // doesn't work with hedera-local-node + .filter { it != "ConsensusPubSubChunkedExample" } // doesn't work on CI + .toList() + + exampleClasses.forEach { className -> + println(""" + + ---EXECUTING $className: + + """.trimIndent()); + + exec.javaexec { + workingDir = workingDirectory.get().asFile + classpath = rtClasspath + mainModule = "com.hedera.hashgraph.examples" + mainClass = "com.hedera.hashgraph.sdk.examples.$className" + + // NOTE: Uncomment to enable trace logs in the SDK during the examples + // jvmArgs "-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace" + } + } + } +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.java-base.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.java-base.gradle.kts new file mode 100644 index 0000000000..059cb4a639 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.java-base.gradle.kts @@ -0,0 +1,116 @@ +import net.ltgt.gradle.errorprone.errorprone + +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("java") + id("jacoco") + id("net.ltgt.errorprone") + id("org.gradlex.java-module-dependencies") + id("com.hedera.gradle.base") + id("com.hedera.gradle.repositories") + id("com.hedera.gradle.patch-modules") +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + vendor = JvmVendorSpec.ADOPTIUM + } +} + +jacoco { + toolVersion = "0.8.8" +} + +jvmDependencyConflicts { + consistentResolution.platform("com.hedera.hashgraph:sdk-dependency-versions") +} + +dependencies { + // https://github.com/google/error-prone + // https://errorprone.info/ + errorprone("com.google.errorprone:error_prone_core:2.21.1") + + // https://github.com/uber/NullAway + errorprone("com.uber.nullaway:nullaway:0.10.14") + + // https://github.com/grpc/grpc-java-api-checker + errorprone("io.grpc:grpc-java-api-checker:1.1.0") +} + +tasks.withType().configureEach { + options.encoding = "UTF-8" + + // Disable warnings because I'm tired of them :P + options.isWarnings = false + + options.errorprone { + // https://github.com/uber/NullAway + warn("NullAway") + option("NullAway:AnnotatedPackages", "com.hedera.hashgraph.sdk") + option("NullAway:TreatGeneratedAsUnannotated", "true") + + // https://github.com/grpc/grpc-java-api-checker + disable("GrpcExperimentalApi") + warn("GrpcInternal") + + // Enable _all_ error prone checks then selectively disble + // Checks that are default-disabled are enabled as warnings + allDisabledChecksAsWarnings = true + disable("TryFailRefactoring") + disable("ThrowSpecificExceptions") + disable("FutureReturnValueIgnored") + disable("FieldCanBeFinal") + disable("Finally") + disable("BooleanParameter") + disable("ThreadJoinLoop") + disable("UnnecessaryDefaultInEnumSwitch") + disable("UngroupedOverloads") + disable("InlineMeSuggester") + + // Uncomment do disable Android + JDK7 checks + // disable("Java7ApiChecker") + // disable("AndroidJdkLibsChecker") + + // Ignore generated and protobuf code + disableWarningsInGeneratedCode = true + excludedPaths = ".*generated.*" + } +} + +tasks.withType().configureEach { + isPreserveFileTimestamps = false + isReproducibleFileOrder = true + filePermissions { unix("0664") } + dirPermissions { unix("0775") } +} + +tasks.buildDependents { setGroup(null) } + +tasks.buildNeeded { setGroup(null) } + +tasks.jar { setGroup(null) } + +tasks.test { group = "build" } + +tasks.checkAllModuleInfo { group = "build" } + +sourceSets.all { + // Remove 'classes' tasks from 'build' group to keep it cleaned up + tasks.named(classesTaskName) { group = null } +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts new file mode 100644 index 0000000000..7ba6b3d212 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.google.protobuf.gradle.id +import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL + +plugins { + id("java-library") + id("com.google.protobuf") + id("com.github.spotbugs") + id("org.sonarqube") + id("com.hedera.gradle.java-base") + id("com.hedera.gradle.publish") +} + +@Suppress("UnstableApiUsage") +testing.suites { + named("test") { + useJUnitJupiter() + } + register("testIntegration") { + testType = TestSuiteType.INTEGRATION_TEST + targets.all { + testTask { + group = "build" + systemProperty("CONFIG_FILE", providers.gradleProperty("CONFIG_FILE").getOrElse("")) + systemProperty("HEDERA_NETWORK", providers.gradleProperty("HEDERA_NETWORK").getOrElse("")) + systemProperty("OPERATOR_ID", providers.gradleProperty("OPERATOR_ID").getOrElse("")) + systemProperty("OPERATOR_KEY", providers.gradleProperty("OPERATOR_KEY").getOrElse("")) + } + } + } +} + +tasks.withType().configureEach { + // NOTE: Uncomment to enable trace logs in the SDK during tests + // jvmArgs("-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace") + + // emit logs per passed or failed test + testLogging { + exceptionFormat = FULL + events("passed", "skipped", "failed", "standardOut", "standardError") + } + + // propagate system environment to test runner + systemProperty("OPERATOR_ID", providers.gradleProperty("OPERATOR_ID").getOrElse("")) + systemProperty("OPERATOR_KEY", providers.gradleProperty("OPERATOR_KEY").getOrElse("")) + systemProperty("CONFIG_FILE", providers.gradleProperty("CONFIG_FILE").getOrElse("")) + systemProperty("HEDERA_NETWORK", providers.gradleProperty("HEDERA_NETWORK").getOrElse("")) +} + +tasks.withType().configureEach { + options { + this as StandardJavadocDocletOptions + encoding = "UTF-8" + addStringOption("Xdoclint:all,-missing", "-quiet") + addStringOption("Xwerror", "-quiet") + } +} + +tasks.jacocoTestReport { + // make sure to use any/all test coverage data for the report and run all tests before this report is made + executionData.from( + tasks.test.map { it.extensions.getByType().destinationFile!! }, + tasks.named("testIntegration").map { it.extensions.getByType().destinationFile!! } + ) + + // remove generated proto files from report + classDirectories.setFrom(sourceSets.main.get().output.asFileTree.matching { + exclude( + "**/proto/**", + "**/AccountAllowanceAdjustTransaction.*", + "**/HederaPreCheckStatusException.*", + "**/HederaReceiptStatusException.*" + ) + }) + + // configure it so only xml is generated for the report + reports { + xml.required = true + html.required = true + csv.required = false + } +} + + +// https://github.com/google/protobuf-gradle-plugin +protobuf { + protoc { + artifact = "com.google.protobuf:protoc:3.21.9" + } + plugins { + id("grpc") { + artifact = "io.grpc:protoc-gen-grpc-java:1.50.2" + } + } +} +tasks.generateProto { + plugins { plugins.register("grpc") } +} + +tasks.compileJava { + options.javaModuleVersion = project.version.toString() +} + +tasks.jar { + exclude("**/*.proto") + includeEmptyDirs = false + manifest { + attributes["Implementation-Version"] = project.version + } +} + +sourceSets.all { + configurations[getTaskName("", "compileProtoPath")].extendsFrom(configurations["internal"]) +} + +spotbugs { + //ignoreFailures = false + //showStackTraces = true + //showProgress = false + //reportLevel = 'default' + //effort = 'default' + //visitors = [ 'FindSqlInjection', 'SwitchFallthrough' ] + //omitVisitors = [ 'FindNonShortCircuit' ] + reportsDir = layout.buildDirectory.dir("reports/spotbugs") + //includeFilter = file('spotbugs-include.xml') + //excludeFilter = file('spotbugs-exclude.xml') + onlyAnalyze = listOf("com.hedera.hashgraph.sdk.*") + //projectName = name + //release = version + //extraArgs = [ '-nested:false' ] + //jvmArgs = [ '-Duser.language=ja' ] + //maxHeapSize = '512m' +} + +tasks.spotbugsMain { + reports.register("html") { + required = true + outputLocation = layout.buildDirectory.file("reports/spotbugs/main/spotbugs.html") + setStylesheet("fancy-hist.xsl") + } +} + +dependencies { + spotbugs("com.github.spotbugs:spotbugs:4.8.4") + spotbugs("com.google.code.findbugs:jsr305:3.0.2") +} + +sonarqube { + properties { + property("sonar.projectKey", "hashgraph_hedera-sdk-java") + property("sonar.organization", "hashgraph") + property("sonar.host.url", "https://sonarcloud.io") + property("sonar.exclusions", "examples/**") + } +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts new file mode 100644 index 0000000000..31a69b6936 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("java") + id("org.gradlex.extra-java-module-info") + id("org.gradlex.jvm-dependency-conflict-resolution") +} + +// Do annotation processing on the classpath, because 'Error Prone' has many non-module dependencies +sourceSets.all { + configurations.getByName(annotationProcessorConfigurationName) { + attributes { attribute(Attribute.of("javaModule", Boolean::class.javaObjectType), false) } + } +} + +// Fix or enhance the metadata of third-party Modules. This is about the metadata in the +// repositories: '*.pom' and '*.module' files. +jvmDependencyConflicts.patch { + // These compile time annotation libraries are not of interest in our setup and are thus removed + // from the dependencies of all components that bring them in. + val annotationLibraries = + listOf( + "com.google.android:annotations", + "com.google.code.findbugs:annotations", + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.checkerframework:checker-compat-qual", + "org.checkerframework:checker-qual", + "org.codehaus.mojo:animal-sniffer-annotations" + ) + + module("com.github.spotbugs:spotbugs-annotations") { annotationLibraries.forEach { removeDependency(it) } } + module("com.google.guava:guava") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-api") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-context") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-core") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-netty-shaded") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-protobuf") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-protobuf-lite") { annotationLibraries.forEach { removeDependency(it) } } + module("io.grpc:grpc-util") { annotationLibraries.forEach { removeDependency(it) } } + + // Testing only + module("org.jetbrains.kotlin:kotlin-stdlib") { removeDependency("org.jetbrains.kotlin:kotlin-stdlib-common") } + module("junit:junit") { removeDependency("org.hamcrest:hamcrest-core") } +} + +// Fix or enhance the 'module-info.class' of third-party Modules. This is about the +// 'module-info.class' inside the Jar files. In our full Java Modules setup every +// Jar needs to have this file. If it is missing, it is added by what is configured here. +extraJavaModuleInfo { + failOnAutomaticModules = true // Only allow Jars with 'module-info' on all module paths + + module("com.esaulpaugh:headlong", "headlong") + module("com.github.spotbugs:spotbugs-annotations", "com.github.spotbugs.annotations") + module("com.google.errorprone:error_prone_annotations", "com.google.errorprone.annotations") + module("com.google.guava:failureaccess", "com.google.common.util.concurrent.internal") + module("com.google.guava:guava", "com.google.common") { + exportAllPackages() + requires("com.google.common.util.concurrent.internal") + requires("java.logging") + } + module("guava-32.1.3-jre.jar", "com.google.common") { + /** + * Repetition of the rule above: + * + * There is an issue when the version is "android", but the selected Jar + * with classifier is "jre". If this causes a problem depends on the local + * Gradle dependency cache state (most likely). + * This is an issue that needs to be investigated and fixed in + * https://github.com/gradlex-org/extra-java-module-info + */ + exportAllPackages() + requires("com.google.common.util.concurrent.internal") + requires("java.logging") + } + module("com.google.protobuf:protobuf-java", "com.google.protobuf") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + requires("jdk.unsupported") + } + module("com.google.protobuf:protobuf-javalite", "com.google.protobuf") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + requires("jdk.unsupported") + } + module("io.grpc:grpc-api", "io.grpc") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + uses("io.grpc.LoadBalancerProvider") + uses("io.grpc.ManagedChannelProvider") + uses("io.grpc.NameResolverProvider") + } + module("io.grpc:grpc-context", "io.grpc.context") + module("io.grpc:grpc-core", "io.grpc.internal") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + } + module("io.grpc:grpc-inprocess", "io.grpc.inprocess") + module("io.grpc:grpc-protobuf-lite", "io.grpc.protobuf.lite") + module("io.grpc:grpc-protobuf", "io.grpc.protobuf") + module("io.grpc:grpc-stub", "io.grpc.stub") { + exportAllPackages() + requireAllDefinedDependencies() + requires("java.logging") + } + module("io.perfmark:perfmark-api", "io.perfmark") + module("javax.annotation:javax.annotation-api", "java.annotation") { + exportAllPackages() + mergeJar("com.google.code.findbugs:jsr305") + } + module("org.jetbrains:annotations", "org.jetbrains.annotations") + + // Full protobuf only + 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() + requires("java.logging") + requires("jdk.unsupported") + ignoreServiceProvider("reactor.blockhound.integration.BlockHoundIntegration") + } + module("io.grpc:grpc-util", "io.grpc.util") + module("io.github.cdimascio:java-dotenv", "java.dotenv") + module("io.github.json-snapshot:json-snapshot", "json.snapshot") + module("junit:junit", "junit") + module("org.mockito:mockito-core", "org.mockito") + module("org.mockito:mockito-junit-jupiter", "org.mockito.junit.jupiter") + module("org.objenesis:objenesis", "org.objenesis") +} + +dependencies { + javaModulesMergeJars("com.google.code.findbugs:jsr305:3.0.2") +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.publish.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.publish.gradle.kts new file mode 100644 index 0000000000..ad2ff125bc --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.publish.gradle.kts @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("java") + id("maven-publish") + id("signing") +} + +java { + withJavadocJar() + withSourcesJar() +} + +tasks.withType().configureEach { setGroup(null) } + +val mavenJava = publishing.publications.create("mavenJava") { + from(components["java"]) + + versionMapping { + allVariants { fromResolutionResult() } + } + + suppressAllPomMetadataWarnings() + + pom { + name = "Hedera SDK" + description = "Hederaâ„¢ Hashgraph SDK for Java" + url = "https://github.com/hashgraph/hedera-sdk-java" + + organization { + name = "Hedera Hashgraph" + url = "https://www.hedera.com" + } + + issueManagement { + system = "GitHub" + url = "https://github.com/hashgraph/hedera-sdk-java/issues" + } + + licenses { + license { + name = "Apache License, Version 2.0" + url = "https://github.com/hashgraph/hedera-sdk-java/blob/main/LICENSE" + distribution = "repo" + } + } + + scm { + url = "https://github.com/hashgraph/hedera-sdk-java" + connection = "scm:git:https://github.com/hashgraph/hedera-sdk-java.git" + developerConnection = "scm:git:ssh://github.com:hashgraph/hedera-sdk-java.git" + } + + developers { + developer { + name = "Ryan Leckey" + } + + developer { + name = "Daniel Akhterov" + } + } + } +} + +signing { + sign(mavenJava) + useGpgCmd() +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts new file mode 100644 index 0000000000..cf1df18271 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +repositories { + maven("https://jitpack.io") { + content { includeModule("io.github.cdimascio", "java-dotenv") } + } + mavenCentral() +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts new file mode 100644 index 0000000000..c10222f1b2 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("com.hedera.gradle.repositories") + id("com.autonomousapps.dependency-analysis") + id("io.github.gradle-nexus.publish-plugin") +} + +val productVersion = layout.projectDirectory.file("version.txt").asFile.readText().trim() + +tasks.register("showVersion") { + group = "versioning" + + inputs.property("version", productVersion) + + doLast { println(inputs.properties["version"]) } +} + +nexusPublishing { + repositories { + sonatype { } + } +} + +tasks.named("closeSonatypeStagingRepository") { + // The publishing of all components to Maven Central is automatically done before close + // (which is done before release). + dependsOn(":sdk:publishToSonatype") + dependsOn(":sdk-full:publishToSonatype") +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk-full.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk-full.gradle.kts new file mode 100644 index 0000000000..0caa68a9ce --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk-full.gradle.kts @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("com.hedera.gradle.java") +} + +javaModuleDependencies.moduleNameToGA.put("com.google.protobuf", "com.google.protobuf:protobuf-java") + +val sdkSrcMainProto = layout.projectDirectory.dir("../sdk/src/main/proto") +val sdkSrcMainJava = layout.projectDirectory.dir("../sdk/src/main/java").asFileTree.matching { + exclude("module-info.java") +} +val sdkSrcMainResources = layout.projectDirectory.dir("../sdk/src/main/resources") + +tasks.generateProto { + addIncludeDir(files(sdkSrcMainProto)) + addSourceDirs(files(sdkSrcMainProto)) +} + +tasks.compileJava { + source(sdkSrcMainJava) +} + +tasks.processResources { + from(sdkSrcMainResources) +} + +tasks.javadoc { + source(sdkSrcMainJava) +} + +tasks.named("sourcesJar") { + from(sdkSrcMainJava) + from(sdkSrcMainResources) +} + +// 'sdk-full' is an alternative to 'sdk'. They cannot be used together. +// We express this via capability. +val sdkCapability = "${project.group}:sdk:${project.version}" +val sdkFullCapability = "${project.group}:${project.name}:${project.version}" +configurations.apiElements { + outgoing.capability(sdkFullCapability) // The default capability + outgoing.capability(sdkCapability) // The 'sdk' capability +} +configurations.runtimeElements { + outgoing.capability(sdkFullCapability) // The default capability + outgoing.capability(sdkCapability) // The 'sdk' capability +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk.gradle.kts new file mode 100644 index 0000000000..dbab542868 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.sdk.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("com.hedera.gradle.java") +} + +javaModuleDependencies.moduleNameToGA.put("com.google.protobuf", "com.google.protobuf:protobuf-javalite") + +tasks.generateProto { + builtins.named("java") { option("lite") } + plugins.named("grpc") { option("lite") } +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts new file mode 100644 index 0000000000..8af46f309e --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + +plugins { + id("com.gradle.develocity") + id("org.gradle.toolchains.foojay-resolver-convention") +} + +includeBuild(".") + +// Enable Gradle Build Scan +develocity { + buildScan { + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" + publishing.onlyIf { false } // only publish with explicit '--scan' + } +} + +val isCiServer = System.getenv().containsKey("CI") +val gradleCacheUsername: String? = System.getenv("GRADLE_CACHE_USERNAME") +val gradleCachePassword: String? = System.getenv("GRADLE_CACHE_PASSWORD") +val gradleCacheAuthorized = + (gradleCacheUsername?.isNotEmpty() ?: false) && (gradleCachePassword?.isNotEmpty() ?: false) + +buildCache { + remote { + url = uri("https://cache.gradle.hedera.svcs.eng.swirldslabs.io/cache/") + isPush = isCiServer && gradleCacheAuthorized + + isUseExpectContinue = true + isEnabled = !gradle.startParameter.isOffline + + if (isCiServer && gradleCacheAuthorized) { + credentials { + username = gradleCacheUsername + password = gradleCachePassword + } + } + } +} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts new file mode 100644 index 0000000000..ff11b2d4a8 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2023-2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("java-platform") + id("org.gradlex.java-module-versions") +} + +group = "com.hedera.hashgraph" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49177..e6441136f3 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930b..a4413138c9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4269..b740cf1339 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index 6689b85bee..7101f8e467 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/sdk-dependency-versions/build.gradle.kts b/sdk-dependency-versions/build.gradle.kts new file mode 100644 index 0000000000..b375360e5e --- /dev/null +++ b/sdk-dependency-versions/build.gradle.kts @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("com.hedera.gradle.versions") +} + +dependencies.constraints { + api("com.esaulpaugh:headlong:10.0.0") { + because("headlong") + } + api("com.github.spotbugs:spotbugs-annotations:4.7.3") { + because("com.github.spotbugs.annotations") + } + api("com.google.errorprone:error_prone_annotations:2.21.1") { + because("com.google.errorprone.annotations") + } + api("com.google.code.gson:gson:2.10.1") { + because("com.google.gson") + } + api("com.google.protobuf:protobuf-java:3.21.9") { + because("com.google.protobuf") + } + api("com.google.protobuf:protobuf-javalite:3.21.9") { + because("com.google.protobuf") + } + api("io.grpc:grpc-api:1.64.0") { + because("io.grpc") + } + api("io.grpc:grpc-inprocess:1.64.0") { + because("io.grpc.protobuf") + } + api("io.grpc:grpc-protobuf:1.64.0") { + because("io.grpc.protobuf") + } + api("io.grpc:grpc-protobuf-lite:1.64.0") { + because("io.grpc.protobuf") + } + api("io.grpc:grpc-stub:1.64.0") { + because("io.grpc.stub") + } + api("javax.annotation:javax.annotation-api:1.3.2") { + because("java.annotation") + } + api("org.bouncycastle:bcpkix-jdk18on:1.76") { + because("org.bouncycastle.pkix") + } + api("org.bouncycastle:bcprov-jdk18on:1.76") { + because("org.bouncycastle.provider") + } + api("org.slf4j:slf4j-api:2.0.9") { + because("org.slf4j") + } + api("org.slf4j:slf4j-simple:2.0.9") { + because("org.slf4j.simple") + } + + // Testing + api("io.github.cdimascio:java-dotenv:5.3.1") { + because("java.dotenv") + } + api("io.github.json-snapshot:json-snapshot:1.0.17") { + because("json.snapshot") + } + api("org.apache.commons:commons-lang3:3.14.0") { + because("org.apache.commons.lang3") + } + api("org.assertj:assertj-core:3.24.2") { + because("org.assertj.core") + } + + // Examples + api("org.jetbrains.kotlin:kotlin-stdlib:1.9.22") { + because("kotlin.stdlib") + } +} diff --git a/sdk-full/build.gradle.kts b/sdk-full/build.gradle.kts new file mode 100644 index 0000000000..b48dd779bc --- /dev/null +++ b/sdk-full/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id("com.hedera.gradle.sdk-full") +} + +// Define dependency constraints for gRPC implementations so that clients automatically get the correct version +dependencies.constraints { + api("io.grpc:grpc-netty:1.64.0") + api("io.grpc:grpc-netty-shaded:1.64.0") + api("io.grpc:grpc-okhttp:1.64.0") +} diff --git a/sdk-full/src/main/java/module-info.java b/sdk-full/src/main/java/module-info.java new file mode 100644 index 0000000000..1e67a76fab --- /dev/null +++ b/sdk-full/src/main/java/module-info.java @@ -0,0 +1,25 @@ +module com.hedera.hashgraph.sdk.full { + requires transitive com.google.protobuf; + + requires com.google.common; + requires com.google.gson; + requires headlong; + requires io.grpc.inprocess; + requires io.grpc.protobuf; + requires io.grpc.stub; + requires io.grpc; + requires java.net.http; + requires org.bouncycastle.pkix; + requires org.bouncycastle.provider; + requires org.slf4j; + + requires static com.github.spotbugs.annotations; + requires static com.google.errorprone.annotations; + requires static java.annotation; + + exports com.hedera.hashgraph.sdk; + exports com.hedera.hashgraph.sdk.logger; + exports com.hedera.hashgraph.sdk.proto; + + opens com.hedera.hashgraph.sdk; +} diff --git a/sdk/build.gradle b/sdk/build.gradle deleted file mode 100644 index 56bdfed061..0000000000 --- a/sdk/build.gradle +++ /dev/null @@ -1,247 +0,0 @@ -plugins { - id "java-library" - id "idea" - id "signing" - id "maven-publish" - id "com.google.protobuf" version "0.9.4" - id "com.github.spotbugs" version "5.1.3" -} - -apply from: "../version.gradle" -apply from: "./sdk.gradle" - -configurations { - integrationTestImplementation.extendsFrom testImplementation - integrationTestRuntimeOnly.extendsFrom testRuntimeOnly -} - -task sourcesJar(type: Jar) { - dependsOn("assemble") - duplicatesStrategy "exclude" - from sourceSets.main.allSource - archiveClassifier = 'sources' -} - -task javadocJar(type: Jar) { - from javadoc - archiveClassifier = 'javadoc' -} - -dependencies { - // https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-annotations - implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.7.3' - - // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15to18 - implementation group: 'org.bouncycastle', name: 'bcprov-jdk15to18', version: '1.76' - - // https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15to18 - implementation group: 'org.bouncycastle', name: 'bcpkix-jdk15to18', version: '1.76' - - // https://mvnrepository.com/artifact/org.slf4j/slf4j-api - implementation 'org.slf4j:slf4j-api:2.0.9' - - implementation "io.grpc:grpc-core:1.57.2" - implementation "io.grpc:grpc-stub:1.58.0" - - implementation "com.google.code.gson:gson:2.10.1" - implementation 'javax.annotation:javax.annotation-api:1.3.2' - implementation 'com.esaulpaugh:headlong:10.0.0' - - testImplementation "org.assertj:assertj-core:3.24.2" - testImplementation "io.github.json-snapshot:json-snapshot:1.0.17" - testImplementation "org.junit.jupiter:junit-jupiter-engine:5.10.0" - testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0" - - testRuntimeOnly "org.slf4j:slf4j-simple:2.0.9" - testRuntimeOnly "io.grpc:grpc-netty-shaded:1.57.2" - testRuntimeOnly 'org.slf4j:slf4j-nop:2.0.9' - - integrationTestRuntimeOnly 'io.grpc:grpc-netty-shaded:1.57.2' - integrationTestRuntimeOnly 'org.slf4j:slf4j-nop:2.0.9' -} - -// https://github.com/google/protobuf-gradle-plugin -protobuf { - protoc { - artifact = "com.google.protobuf:protoc:3.23.4" - } - plugins { - grpc { - artifact = "io.grpc:protoc-gen-grpc-java:1.58.0" - } - } -} - -spotbugs { - //ignoreFailures = false - //showStackTraces = true - //showProgress = false - //reportLevel = 'default' - //effort = 'default' - //visitors = [ 'FindSqlInjection', 'SwitchFallthrough' ] - //omitVisitors = [ 'FindNonShortCircuit' ] - reportsDir = file("$buildDir/reports/spotbugs") - //includeFilter = file('spotbugs-include.xml') - //excludeFilter = file('spotbugs-exclude.xml') - onlyAnalyze = ['com.hedera.hashgraph.sdk.*'] - //projectName = name - //release = version - //extraArgs = [ '-nested:false' ] - //jvmArgs = [ '-Duser.language=ja' ] - //maxHeapSize = '512m' -} - -spotbugsMain { - reports { - html { - required = true - outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html") - stylesheet = 'fancy-hist.xsl' - } - } -} - -sourceSets { - main { - java { - srcDirs 'src/main/java' - srcDirs 'build/generated/source/proto/main/java' - srcDirs 'build/generated/source/proto/main/grpc' - } - } - integrationTest { - java.srcDir "$projectDir/src/integrationTest/java" - - compileClasspath += sourceSets.main.output - runtimeClasspath += sourceSets.main.output - } -} - -idea { - module { - sourceDirs -= file("src/integrationTest/java") - testSourceDirs += file("src/integrationTest/java") - } -} - -task integrationTest(type: Test) { - testClassesDirs = sourceSets.integrationTest.output.classesDirs - classpath = sourceSets.integrationTest.runtimeClasspath - - onlyIf { - System.getenv('OPERATOR_ID') != null && System.getenv('OPERATOR_KEY') != null || System.getenv('CONFIG_FILE') != null - } -} - -jacocoTestReport { - // make sure to use any/all test coverage data for the report - executionData fileTree(dir: buildDir, include: "jacoco/*.exec") - - // remove generated proto files from report - afterEvaluate { - classDirectories.setFrom(files(classDirectories.files.collect { - fileTree(dir: it, exclude: [ - '**/proto/**', - '**/AccountAllowanceAdjustTransaction.*', - '**/HederaPreCheckStatusException.*', - '**/HederaReceiptStatusException.*' - ]) - })) - } - - // configure it so only xml is generated for the report - reports { - xml.required = true - html.required = true - csv.required = false - } - - // make sure we run all tests before this report is made - dependsOn test, integrationTest -} - -tasks.withType(Javadoc) { - source = sourceSets.main.allJava + file("$buildDir/generated/sources/annotationProcessor/java/main") -} - -tasks.withType(Test) { - useJUnitPlatform() - - // NOTE: Uncomment to enable trace logs in the SDK during tests - // jvmArgs "-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace" - - // this task will fail on the first failed test - failFast = true - - // emit logs per passed or failed test - testLogging { - exceptionFormat = 'full' - events "passed", "skipped", "failed", "standardOut", "standardError" - } - - // propagate system environment to test runner - systemProperty "OPERATOR_ID", findProperty("OPERATOR_ID") - systemProperty "OPERATOR_KEY", findProperty("OPERATOR_KEY") - systemProperty "CONFIG_FILE", findProperty("CONFIG_FILE") - systemProperty "HEDERA_NETWORK", findProperty("HEDERA_NETWORK") -} - -jar { - exclude "**/*.proto" - includeEmptyDirs = false -} - -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = "Hedera SDK" - description = "Hederaâ„¢ Hashgraph SDK for Java" - url = 'https://github.com/hashgraph/hedera-sdk-java' - - organization { - name = "Hedera Hashgraph" - url = "https://www.hedera.com" - } - - issueManagement { - system = "GitHub" - url = "https://github.com/hashgraph/hedera-sdk-java/issues" - } - - licenses { - license { - name = "Apache License, Version 2.0" - url = "https://github.com/hashgraph/hedera-sdk-java/blob/main/LICENSE" - distribution = "repo" - } - } - - scm { - url = "https://github.com/hashgraph/hedera-sdk-java" - connection = "scm:git:https://github.com/hashgraph/hedera-sdk-java.git" - developerConnection = "scm:git:ssh://github.com:hashgraph/hedera-sdk-java.git" - } - - developers { - developer { - name = "Ryan Leckey" - } - - developer { - name = "Daniel Akhterov" - } - } - } - - from(components.java) - artifact sourcesJar - artifact javadocJar - } - } -} - -signing { - sign publishing.publications.mavenJava - useGpgCmd() -} diff --git a/sdk/build.gradle.kts b/sdk/build.gradle.kts new file mode 100644 index 0000000000..c5eb10fc4e --- /dev/null +++ b/sdk/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + id("com.hedera.gradle.sdk") +} + +// Define dependency constraints for gRPC implementations so that clients automatically get the correct version +dependencies.constraints { + api("io.grpc:grpc-netty:1.64.0") + api("io.grpc:grpc-netty-shaded:1.64.0") + api("io.grpc:grpc-okhttp:1.64.0") +} + +testModuleInfo { + requires("json.snapshot") + requires("org.assertj.core") + requires("org.junit.jupiter.api") + requires("org.junit.jupiter.params") + requires("org.mockito") + + requiresStatic("java.annotation") + requiresStatic("com.github.spotbugs.annotations") + requiresStatic("com.google.errorprone.annotations") + + runtimeOnly("io.grpc.netty.shaded") + runtimeOnly("org.slf4j.simple") +} + +testIntegrationModuleInfo { + runtimeOnly("io.grpc.netty.shaded") + runtimeOnly("org.slf4j.simple") +} diff --git a/sdk/protobuf-lite.gradle b/sdk/protobuf-lite.gradle deleted file mode 100644 index 38d1cc5a26..0000000000 --- a/sdk/protobuf-lite.gradle +++ /dev/null @@ -1,25 +0,0 @@ -dependencies { - implementation "io.grpc:grpc-protobuf-lite:1.46.0" - - // Protobuf Lite is used to maintain easy compatibility with Android - // https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md - api "com.google.protobuf:protobuf-javalite:3.21.9" -} - -protobuf { - generateProtoTasks { - all().each { task -> - task.builtins { - java { - option "lite" - } - } - - task.plugins { - grpc { - option "lite" - } - } - } - } -} diff --git a/sdk/protobuf.gradle b/sdk/protobuf.gradle deleted file mode 100644 index db9c64d0aa..0000000000 --- a/sdk/protobuf.gradle +++ /dev/null @@ -1,15 +0,0 @@ -dependencies { - implementation 'io.grpc:grpc-protobuf:1.50.2' - - // Protobuf Lite is used to maintain easy compatibility with Android - // https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md - api "com.google.protobuf:protobuf-java:3.21.8" -} - -protobuf { - generateProtoTasks { - all()*.plugins { - grpc {} - } - } -} diff --git a/sdk/sdk-full.gradle b/sdk/sdk-full.gradle deleted file mode 100644 index cd9ddb50ee..0000000000 --- a/sdk/sdk-full.gradle +++ /dev/null @@ -1,9 +0,0 @@ -apply from: "./protobuf.gradle" - -publishing { - publications { - mavenJava(MavenPublication) { - artifactId = "sdk-full" - } - } -} diff --git a/sdk/sdk.gradle b/sdk/sdk.gradle deleted file mode 100644 index 2f76f44095..0000000000 --- a/sdk/sdk.gradle +++ /dev/null @@ -1,9 +0,0 @@ -apply from: "./protobuf-lite.gradle" - -publishing { - publications { - mavenJava(MavenPublication) { - artifactId = "sdk" - } - } -} diff --git a/sdk/src/integrationTest/resources b/sdk/src/integrationTest/resources deleted file mode 120000 index f0fc1373fc..0000000000 --- a/sdk/src/integrationTest/resources +++ /dev/null @@ -1 +0,0 @@ -sdk/src/main/resources/ \ No newline at end of file diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java index 81faf0c528..55f1750cf7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java +++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java @@ -27,6 +27,8 @@ import io.grpc.ManagedChannelBuilder; import io.grpc.TlsChannelCredentials; import io.grpc.inprocess.InProcessChannelBuilder; + +import java.lang.module.ModuleDescriptor; import java.time.Duration; import java.time.Instant; import java.util.Objects; @@ -362,8 +364,18 @@ synchronized void close(Duration timeout) throws InterruptedException { * @return the user agent string */ private String getUserAgent() { + var theModule = getClass().getModule(); var thePackage = getClass().getPackage(); - var implementationVersion = thePackage != null ? thePackage.getImplementationVersion() : null; + String implementationVersion; + if (theModule.getName() == null) { + // running on classpath + implementationVersion = + thePackage != null ? thePackage.getImplementationVersion() : null; + } else { + // running on module path + implementationVersion = + theModule.getDescriptor().version().map(ModuleDescriptor.Version::toString).orElse(null); + } return "hedera-sdk-java/" + ((implementationVersion != null) ? ("v" + implementationVersion) : "DEV"); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java index 472d0a078e..8f671afab9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java +++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java @@ -30,7 +30,6 @@ import com.hedera.hashgraph.sdk.proto.TransactionResponse; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.grpc.MethodDescriptor; -import org.checkerframework.checker.units.qual.A; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java index 37490f632f..125ad1ceea 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java +++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java @@ -22,7 +22,6 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.checkerframework.checker.units.qual.A; import java.time.Instant; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java index 93b789681b..56a45ef86f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java +++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java @@ -20,7 +20,6 @@ package com.hedera.hashgraph.sdk; import com.google.common.io.ByteStreams; -import com.google.common.io.Resources; import com.google.errorprone.annotations.Var; import com.google.protobuf.ByteString; @@ -185,7 +184,7 @@ static HashMap addressBookToNetwork(Collection a * @return the list of address book records */ static Map readAddressBookResource(String fileName) { - try (var inputStream = Resources.getResource(fileName).openStream()) { + try (var inputStream = Objects.requireNonNull(Network.class.getResource("/" + fileName)).openStream()) { var contents = ByteStreams.toByteArray(inputStream); var nodeAddressBook = NodeAddressBook.fromBytes(ByteString.copyFrom(contents)); var map = new HashMap(); diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java new file mode 100644 index 0000000000..46ea850a50 --- /dev/null +++ b/sdk/src/main/java/module-info.java @@ -0,0 +1,25 @@ +module com.hedera.hashgraph.sdk { + requires transitive com.google.protobuf; + + requires com.google.common; + requires com.google.gson; + requires headlong; + requires io.grpc.inprocess; + requires io.grpc.protobuf.lite; + requires io.grpc.stub; + requires io.grpc; + requires java.net.http; + requires org.bouncycastle.pkix; + requires org.bouncycastle.provider; + requires org.slf4j; + + requires static com.github.spotbugs.annotations; + requires static com.google.errorprone.annotations; + requires static java.annotation; + + exports com.hedera.hashgraph.sdk; + exports com.hedera.hashgraph.sdk.logger; + exports com.hedera.hashgraph.sdk.proto; + + opens com.hedera.hashgraph.sdk; +} diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java index fcb1d57d2e..8266fba925 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java @@ -19,21 +19,22 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class AccountAllowanceApproveTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -49,7 +50,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java index d8e0eae894..d584fb8317 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody; import com.hedera.hashgraph.sdk.proto.CryptoDeleteAllowanceTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java index 521b9546da..cfc151d9d0 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java index c339d39a60..6cb80b95e7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java @@ -20,15 +20,14 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.CryptoCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteAllowanceTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; - import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java index 7322b2e64a..3aabee3465 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java @@ -22,11 +22,11 @@ import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -42,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java index b5bbe245b4..0fc7f876be 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -45,7 +45,7 @@ public static void beforeAll() { previewnetClient = Client.forPreviewnet(); } - @AfterClass + @AfterAll public static void afterAll() throws TimeoutException { mainnetClient.close(); testnetClient.close(); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java index 01860d4e72..9836209e78 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java index 4532d8a032..337d2e5af8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java @@ -25,9 +25,10 @@ import com.hedera.hashgraph.sdk.proto.KeyList; import com.hedera.hashgraph.sdk.proto.LiveHash; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; @@ -62,7 +63,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java index 34b279d403..08168d8d0a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java index 275320a396..b9e47fee57 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java index b1d68db1b4..15cbd8c715 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java @@ -19,16 +19,15 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody; import com.hedera.hashgraph.sdk.proto.CryptoUpdateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; - import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java index d95b8b38e4..ab4bf6c652 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java @@ -10,8 +10,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import java.time.Duration; +import java.time.Duration; import java.util.ArrayDeque; import java.util.Collections; import java.util.List; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java index bcd5a96d74..9d34ab6809 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java @@ -21,7 +21,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -37,7 +37,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java index 8a709fc674..d5743b8155 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java @@ -1,15 +1,22 @@ package com.hedera.hashgraph.sdk; import org.junit.jupiter.api.Test; -import java.time.Duration; +import java.time.Duration; import java.util.Collections; -import java.util.concurrent.*; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; public class ClientCloseTest { @Test diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java index bf7517f4d5..31ccd9faa3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java @@ -25,13 +25,13 @@ import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.NullSource; import org.junit.jupiter.params.provider.ValueSource; -import java.time.Duration; import javax.annotation.Nullable; import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.time.Instant; import java.util.HashMap; import java.util.List; @@ -39,7 +39,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatThrownBy; class ClientTest { @Test diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java index 4f58f86485..aa279445b5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java @@ -1,16 +1,17 @@ package com.hedera.hashgraph.sdk; +import org.junit.jupiter.api.Test; + +import java.util.concurrent.CompletableFuture; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.util.concurrent.CompletableFuture; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import org.junit.jupiter.api.Test; - class ConsumerHelperTest { @Test void biConsumer() { diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java index 4a27e8a73d..839fb0ceb3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java index 02d5bdfdbf..32436cc68f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java @@ -21,9 +21,10 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; public class ContractCallQueryTest { @@ -37,7 +38,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java index 713c9a4337..2c5d4b24c5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java @@ -19,17 +19,16 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.ContractCallTransactionBody; import com.hedera.hashgraph.sdk.proto.ContractCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; - import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -45,7 +44,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java index 8d4cc409c4..f95dbb200c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java @@ -20,14 +20,13 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.ContractDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.ContractUpdateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java index 618cead03e..4ece917fbb 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java @@ -21,14 +21,13 @@ import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.ContractCallTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java index 9302f3bb45..58181f66e4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java @@ -21,9 +21,8 @@ import com.google.protobuf.ByteString; import io.github.jsonSnapshot.SnapshotMatcher; -import java.util.List; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; @@ -48,7 +47,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java index b3efb69f14..2af71666de 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -35,7 +35,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java index 42a7466547..0e3846b68d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java index 412f30fed0..caadd54dbb 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java @@ -23,9 +23,10 @@ import com.hedera.hashgraph.sdk.proto.ContractGetInfoResponse; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; @@ -49,7 +50,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java index 772c3f0589..d6654eb15a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java @@ -5,7 +5,7 @@ import com.hedera.hashgraph.sdk.proto.ContractLoginfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -24,7 +24,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java index 564d4bfe6a..4603ac35d2 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java @@ -19,16 +19,15 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.ContractCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.ContractUpdateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; - import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java index 451d935b08..42fe1df47d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java @@ -20,16 +20,15 @@ package com.hedera.hashgraph.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionList; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -46,7 +45,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java index 412630c8fd..23ec131bcc 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java @@ -20,7 +20,7 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -35,7 +35,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java index 2cb49bfb10..d87c101439 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -32,7 +32,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java index 4c5fca41f7..0dd799ff27 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java @@ -1,11 +1,12 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - -import java.util.HashSet; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import java.util.HashSet; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + public class DuplicateTransactionTest { @Test diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java index d7d91dc82d..8ff7a1a83e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java @@ -25,7 +25,6 @@ import org.junit.jupiter.api.Test; import java.io.IOException; -import java.nio.charset.StandardCharsets; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java index e09e8dd326..90d1423b0b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java @@ -19,10 +19,10 @@ */ package com.hedera.hashgraph.sdk; -import java.math.BigDecimal; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import java.math.BigDecimal; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java index 4070401089..985fa26536 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java @@ -19,7 +19,6 @@ */ package com.hedera.hashgraph.sdk; -import java.util.stream.Stream; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; @@ -30,6 +29,7 @@ import java.io.IOException; import java.io.StringReader; import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java index f7c425d024..9a6ee334f3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java @@ -19,12 +19,12 @@ */ package com.hedera.hashgraph.sdk; -import java.math.BigDecimal; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.math.BigDecimal; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java index cc61f4768d..e8c67b418e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java @@ -1,7 +1,7 @@ package com.hedera.hashgraph.sdk; import org.bouncycastle.util.encoders.Hex; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java index 1464395e78..7dfe891bfa 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java @@ -2,11 +2,11 @@ import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -22,7 +22,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java index b6adf40f6e..e9450ca3d8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java @@ -22,6 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; + import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java index af628d1205..0331511581 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java @@ -19,14 +19,6 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - import com.hedera.hashgraph.sdk.logger.LogLevel; import com.hedera.hashgraph.sdk.logger.Logger; import com.hedera.hashgraph.sdk.proto.QueryHeader; @@ -36,6 +28,11 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.stubbing.Answer; + +import javax.annotation.Nullable; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -45,10 +42,14 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Nullable; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.stubbing.Answer; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; class ExecutableTest { Client client; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java index c8566fbe6c..43f3b1d5f2 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java @@ -20,9 +20,10 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; @@ -33,7 +34,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java index b45a8f668c..f2c4399834 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java @@ -19,16 +19,15 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoUpdateTransactionBody; import com.hedera.hashgraph.sdk.proto.FileAppendTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -95,7 +94,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java index eaee5ae20c..e722ba6b5e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java index 43e91243af..05ae6a7e25 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.FileAppendTransactionBody; import com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java index 251f0f2c4d..e2653b8e4e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.FileDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java index ab8850e264..ff1ae39f8e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -32,7 +32,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java index c939a0a692..b55e58cb0a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java index ad6b531e08..02276f3fa8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java @@ -24,9 +24,10 @@ import com.hedera.hashgraph.sdk.proto.KeyList; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; @@ -49,7 +50,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java index b7ee03c94b..8439297d02 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.FileDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.FileUpdateTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java index 4383337036..b52d7e3dce 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java @@ -19,23 +19,24 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.FreezeTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.Timestamp; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class FreezeTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java index 2423b5dad9..0156d26ad4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java @@ -19,7 +19,6 @@ */ package com.hedera.hashgraph.sdk; -import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -27,6 +26,7 @@ import java.math.BigDecimal; import java.util.Iterator; +import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java index 27c3be4df8..20fe1397ab 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java @@ -1,15 +1,16 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.Key; -import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + class KeyListTest { private static final PublicKey mTestPublicKey1 = PrivateKey.fromStringED25519( diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java index 8129c01e91..cbe69a6ef8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java @@ -2,13 +2,13 @@ import com.google.protobuf.ByteString; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -24,7 +24,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java index 29fc13239a..83904c8901 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java @@ -2,13 +2,12 @@ import com.google.protobuf.ByteString; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -24,7 +23,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java index 9b4228239b..45c1ba6f04 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java @@ -1,9 +1,8 @@ package com.hedera.hashgraph.sdk; -import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -15,7 +14,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java index 031324b1f3..a956856215 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.ConsensusDeleteTopicTransactionBody; import com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java index 4322d8dd68..f3390d043b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java @@ -21,9 +21,17 @@ import com.hedera.hashgraph.sdk.logger.LogLevel; import com.hedera.hashgraph.sdk.logger.Logger; -import com.hedera.hashgraph.sdk.proto.*; +import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; +import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; +import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; +import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; +import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerMethodDefinition; +import io.grpc.ServerServiceDefinition; +import io.grpc.ServiceDescriptor; import io.grpc.Status; -import io.grpc.*; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.ServerCalls; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java index c88bef9081..52b837b453 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java @@ -41,16 +41,15 @@ import com.hedera.hashgraph.sdk.proto.TransactionResponse; import io.grpc.Status; import io.grpc.stub.StreamObserver; -import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import java.time.Duration; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java index 7aa33f9d87..21ed0fedfa 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java @@ -4,7 +4,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import com.hedera.hashgraph.sdk.proto.Transaction; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java index 5077f19798..840daea7cc 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java @@ -1,7 +1,7 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -13,7 +13,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java index e44d99ce19..b95ec11cf4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -44,7 +44,7 @@ public static void beforeAll() { previewnetClient = Client.forPreviewnet(); } - @AfterClass + @AfterAll public static void afterAll() throws TimeoutException { mainnetClient.close(); testnetClient.close(); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java index a9cbb0fbfd..e349b27178 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java @@ -22,9 +22,9 @@ import com.google.protobuf.InvalidProtocolBufferException; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; -import java.time.Instant; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java index 4fb15c896b..25800d1b66 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java @@ -20,11 +20,11 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; public class PrngTransactionTest { @@ -39,7 +39,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java index 41ecd99b5c..3c8dce924e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java @@ -1,11 +1,10 @@ package com.hedera.hashgraph.sdk; +import com.hedera.hashgraph.sdk.proto.ProxyStaker; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; - -import com.hedera.hashgraph.sdk.proto.ProxyStaker; +import org.junit.jupiter.api.Test; public class ProxyStakerTest { private static final ProxyStaker proxyStaker = ProxyStaker.newBuilder() @@ -18,7 +17,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java index b456d23ff1..650814f086 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java @@ -2,6 +2,7 @@ import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.Test; + import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java index 16498c18c8..13b2f92c0d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java @@ -1,10 +1,10 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.HederaFunctionality; -import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import java.util.Map; +import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java index a9f238c647..d4e9fe4a45 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java @@ -20,11 +20,11 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -40,7 +40,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java index dec9a6e5f7..27c1d85c3d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java @@ -21,13 +21,12 @@ import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.ScheduleDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenUnpauseTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java index d355abb195..1f1233191a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java index c82a543a50..a76f37602d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java @@ -3,9 +3,10 @@ import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; @@ -22,7 +23,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java index 274e622a46..9a8896be74 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java @@ -20,11 +20,11 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -40,7 +40,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java index c9a38a3cad..20ea879798 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java @@ -1,9 +1,10 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; @@ -16,7 +17,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java index 8c3f3b9e14..f70ea65864 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java @@ -19,23 +19,24 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.SystemDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.TimestampSeconds; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class SystemDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -48,7 +49,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java index cd487631c8..2c20687577 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java @@ -20,14 +20,13 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SystemDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.SystemUndeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java index 559542b814..c3d77cfc74 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java @@ -22,9 +22,9 @@ import io.grpc.BindableService; import io.grpc.Server; import io.grpc.inprocess.InProcessServerBuilder; -import java.time.Duration; import java.io.IOException; +import java.time.Duration; import java.util.HashMap; import java.util.concurrent.TimeoutException; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java index 995ee24542..9a38876103 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java @@ -1,10 +1,10 @@ package com.hedera.hashgraph.sdk; +import org.junit.jupiter.api.Test; + import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Test; - public class TokenAllowanceTest { private static final TokenId testTokenId = TokenId.fromString("0.6.9"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java index 70dd07e533..b3218ded3a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java @@ -1,14 +1,14 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class TokenAssociationTest { private static final AccountId testAccountId = AccountId.fromString("4.2.0"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java index 7745167888..f4e4c9109b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java @@ -19,20 +19,21 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenBurnTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public class TokenBurnTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java index f923183854..c6c7934349 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java @@ -19,19 +19,20 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenDeleteTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -43,7 +44,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java index 469e7830ab..dd538681ef 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java @@ -19,20 +19,21 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenDissociateTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenDissociateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java index 29074be72a..5fe90cf58c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java @@ -21,14 +21,13 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenDissociateTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; @@ -42,7 +41,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java index 771fb8b2b6..4d15a62046 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java @@ -20,14 +20,13 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenCreateTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenFreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java index e72037da90..a22ae5da64 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java @@ -19,19 +19,20 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenGrantKycTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenGrantKycTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -45,7 +46,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java index 13ce9060c5..ab7c1d34cf 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java @@ -19,14 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; - import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; + public class TokenInfoQueryTest { private static final TokenId testTokenId = TokenId.fromString("4.2.0"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java index 6987d36693..dc741319d3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java @@ -19,17 +19,18 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; - import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; import java.util.Arrays; import java.util.List; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; // TODO: update this, test deepClone() diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java index 65a68fffc8..0053cc3952 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java @@ -1,20 +1,21 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.time.Instant; import java.util.Arrays; import java.util.List; -import org.junit.AfterClass; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public class TokenMintTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( @@ -30,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java index 141b0a1679..5d7bab65e7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java @@ -2,7 +2,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java index 0d5fc7c0ca..35ce458c35 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java @@ -2,12 +2,12 @@ import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; import javax.annotation.Nullable; +import java.time.Instant; import static org.assertj.core.api.Assertions.assertThat; @@ -19,7 +19,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java index 0e6a353213..4ab67ead3a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java @@ -19,19 +19,20 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenPauseTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenPauseTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -43,7 +44,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java index 77e7678ed0..d96e713a3c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java @@ -1,7 +1,7 @@ package com.hedera.hashgraph.sdk; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -13,7 +13,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java index 43a2066b82..7f6d6d0ae1 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java @@ -19,19 +19,20 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenRevokeKycTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenRevokeKycTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -45,7 +46,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java index 5faefb7637..5719a94c37 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java @@ -19,15 +19,14 @@ */ package com.hedera.hashgraph.sdk; -import com.hedera.hashgraph.sdk.proto.FreezeTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenUnfreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java index fd1b77126c..47b64ec1ef 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java @@ -19,19 +19,20 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenUnpauseTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TokenUnpauseTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); @@ -44,7 +45,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java index 292abd10e6..ef5bf8bd0a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java @@ -19,20 +19,21 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TokenWipeAccountTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.AfterClass; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public class TokenWipeTransactionTest { @@ -49,7 +50,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java index 160385b0f4..ea855fc20c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java @@ -20,15 +20,14 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.ConsensusCreateTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.FreezeTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; - import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -44,7 +43,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java index e325f87d34..e09bca3645 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java @@ -20,14 +20,13 @@ package com.hedera.hashgraph.sdk; import com.hedera.hashgraph.sdk.proto.ConsensusDeleteTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.ConsensusUpdateTopicTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; +import java.time.Instant; import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; @@ -43,7 +42,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java index e48e1ab068..fd2a121cb8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java @@ -22,7 +22,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -32,7 +32,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java index 43327c5e77..dc5978f1a5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java @@ -21,7 +21,7 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,7 +31,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java index 5914b0afc3..9816df4847 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java @@ -25,9 +25,10 @@ import com.hedera.hashgraph.sdk.proto.ConsensusTopicInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; @@ -57,7 +58,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java index a8ee05dd99..0bb9517ac0 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java @@ -1,14 +1,15 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; - import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; import com.hedera.hashgraph.sdk.proto.Timestamp; import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; -import java.time.Instant; import org.junit.jupiter.api.Test; +import java.time.Instant; + +import static org.assertj.core.api.Assertions.assertThat; + public class TopicMessageChunkTest { private static final Instant testTimestamp = Instant.ofEpochSecond(1554158542); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java index dbbd4a33c9..ef67c16b4e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java @@ -37,10 +37,8 @@ import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.StreamObserver; -import java.util.function.Consumer; -import org.apache.commons.lang3.ArrayUtils; import org.assertj.core.api.InstanceOfAssertFactories; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -48,9 +46,9 @@ import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; + import java.time.Duration; import java.time.Instant; - import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; @@ -59,6 +57,7 @@ import java.util.Queue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -80,7 +79,7 @@ static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll static void afterAll() { SnapshotMatcher.validateSnapshots(); } @@ -210,7 +209,7 @@ void subscribeChunked() { subscribeToMirror(received::add); - var message = ArrayUtils.addAll(response1.getMessage().toByteArray(), response2.getMessage().toByteArray()); + var message = combine(response1.getMessage().toByteArray(), response2.getMessage().toByteArray()); assertThat(errors).isEmpty(); assertThat(received) .hasSize(1) @@ -462,4 +461,11 @@ public void verify() { assertThat(responses).isEmpty(); } } + + private byte[] combine(byte[] array1, byte[] array2) { + byte[] joinedArray = new byte[array1.length + array2.length]; + System.arraycopy(array1, 0, joinedArray, 0, array1.length); + System.arraycopy(array2, 0, joinedArray, array1.length, array2.length); + return joinedArray; + } } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java index 8bee382f7d..185627e3ee 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java @@ -1,19 +1,20 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody; import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import java.time.Instant; +import java.util.Arrays; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class TopicMessageSubmitTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java index 28e03da5fd..d3bb8ad63f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java @@ -1,14 +1,15 @@ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; - import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; import com.hedera.hashgraph.sdk.proto.Timestamp; import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import org.junit.jupiter.api.Test; + import java.time.Instant; import java.util.List; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; public class TopicMessageTest { diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java index 81ff5cc1c6..0ce3d89bd8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java @@ -19,9 +19,6 @@ */ package com.hedera.hashgraph.sdk; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import com.google.protobuf.StringValue; import com.hedera.hashgraph.sdk.proto.ConsensusUpdateTopicTransactionBody; import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; @@ -29,12 +26,16 @@ import com.hedera.hashgraph.sdk.proto.Timestamp; import com.hedera.hashgraph.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import java.time.Duration; import java.time.Instant; import java.util.Arrays; -import org.junit.AfterClass; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public class TopicUpdateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( @@ -57,7 +58,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java index 7342666b71..58acda631f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java @@ -20,22 +20,16 @@ package com.hedera.hashgraph.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.*; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionReceipt; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; +import java.time.Instant; import java.util.Objects; -import java.util.concurrent.TimeoutException; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; class TransactionIdTest { @BeforeAll @@ -43,7 +37,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java index bee07c33e8..0124089ecb 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java @@ -21,9 +21,10 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; public class TransactionReceiptQueryTest { @@ -37,7 +38,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java index 7cfe58375e..b09a67fbe4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java @@ -2,12 +2,12 @@ import com.google.protobuf.ByteString; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java index b55c2e7349..c2366da45f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java @@ -21,9 +21,10 @@ import com.hedera.hashgraph.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; + import java.time.Instant; public class TransactionRecordQueryTest { @@ -37,7 +38,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java index 20ab3b7e4c..c5174ba37e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java @@ -23,13 +23,13 @@ import com.google.protobuf.BytesValue; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; import javax.annotation.Nullable; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -47,7 +47,7 @@ public static void beforeAll() { SnapshotMatcher.start(); } - @AfterClass + @AfterAll public static void afterAll() { SnapshotMatcher.validateSnapshots(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java index 1fc72603a1..71941375af 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java @@ -19,18 +19,19 @@ */ package com.hedera.hashgraph.sdk; -import static com.hedera.hashgraph.sdk.Transaction.fromBytes; -import static org.assertj.core.api.Assertions.assertThat; - import com.google.protobuf.InvalidProtocolBufferException; import com.hedera.hashgraph.sdk.proto.SignedTransaction; import com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody; import com.hedera.hashgraph.sdk.proto.TransactionBody; +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.Test; + import java.time.Instant; import java.util.Arrays; import java.util.List; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.Test; + +import static com.hedera.hashgraph.sdk.Transaction.fromBytes; +import static org.assertj.core.api.Assertions.assertThat; public class TransactionTest { diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java index 1aa27600ff..84956f1306 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java @@ -3,7 +3,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; class LoggerTest { diff --git a/sdk/src/integrationTest/java/AccountAllowanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AccountAllowanceIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java index b683eb43e6..542c45a445 100644 --- a/sdk/src/integrationTest/java/AccountAllowanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; @@ -5,7 +7,6 @@ import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.TransactionId; import com.hedera.hashgraph.sdk.TransferTransaction; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/integrationTest/java/AccountBalanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/AccountBalanceIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java index afa41433c0..f1bc28fb6a 100644 --- a/sdk/src/integrationTest/java/AccountBalanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; diff --git a/sdk/src/integrationTest/java/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/AccountCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java index c93b198df7..9f1ae48867 100644 --- a/sdk/src/integrationTest/java/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/integrationTest/java/AccountDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AccountDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java index 1657167153..e62e6ba10e 100644 --- a/sdk/src/integrationTest/java/AccountDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; import com.hedera.hashgraph.sdk.AccountInfoQuery; diff --git a/sdk/src/integrationTest/java/AccountIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AccountIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java index be0fb8e1f7..05ac27fbee 100644 --- a/sdk/src/integrationTest/java/AccountIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.hedera.hashgraph.sdk.AccountId; diff --git a/sdk/src/integrationTest/java/AccountInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AccountInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java index 0e5d435e02..9587f37d63 100644 --- a/sdk/src/integrationTest/java/AccountInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountInfoFlow; import com.hedera.hashgraph.sdk.AccountInfoQuery; diff --git a/sdk/src/integrationTest/java/AccountRecordsIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java similarity index 97% rename from sdk/src/integrationTest/java/AccountRecordsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java index 704ff06065..93cac9c5f0 100644 --- a/sdk/src/integrationTest/java/AccountRecordsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountRecordsQuery; import com.hedera.hashgraph.sdk.Hbar; diff --git a/sdk/src/integrationTest/java/AccountStakersIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java similarity index 94% rename from sdk/src/integrationTest/java/AccountStakersIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java index bbc74f4c62..3ecd404f52 100644 --- a/sdk/src/integrationTest/java/AccountStakersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountStakersQuery; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/AccountUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AccountUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java index 92bf25fa99..362e0b9552 100644 --- a/sdk/src/integrationTest/java/AccountUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountInfoQuery; diff --git a/sdk/src/integrationTest/java/AutomaticAssociationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AutomaticAssociationTest.java similarity index 98% rename from sdk/src/integrationTest/java/AutomaticAssociationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AutomaticAssociationTest.java index fd6bdcf1f0..3f352f5bc0 100644 --- a/sdk/src/integrationTest/java/AutomaticAssociationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AutomaticAssociationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountInfoQuery; import com.hedera.hashgraph.sdk.AccountUpdateTransaction; diff --git a/sdk/src/integrationTest/java/ClientIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ClientIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java index 11859ae53d..c26a632f5e 100644 --- a/sdk/src/integrationTest/java/ClientIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.*; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/integrationTest/java/Contents.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java similarity index 99% rename from sdk/src/integrationTest/java/Contents.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java index 4223c2a860..a991ecb23c 100644 --- a/sdk/src/integrationTest/java/Contents.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + public class Contents { private Contents() { } diff --git a/sdk/src/integrationTest/java/ContractBytecodeIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractBytecodeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java index 758a9f595e..5a82237e78 100644 --- a/sdk/src/integrationTest/java/ContractBytecodeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractByteCodeQuery; import com.hedera.hashgraph.sdk.ContractCreateTransaction; diff --git a/sdk/src/integrationTest/java/ContractCallIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractCallIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java index e6021ddc67..ccb53a382e 100644 --- a/sdk/src/integrationTest/java/ContractCallIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractCallQuery; import com.hedera.hashgraph.sdk.ContractCreateTransaction; diff --git a/sdk/src/integrationTest/java/ContractCreateFlowIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractCreateFlowIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java index 8cf1d1b291..24e73beb2d 100644 --- a/sdk/src/integrationTest/java/ContractCreateFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/integrationTest/java/ContractCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java index cdf8b402e8..8a96b96daa 100644 --- a/sdk/src/integrationTest/java/ContractCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractCreateTransaction; import com.hedera.hashgraph.sdk.ContractDeleteTransaction; diff --git a/sdk/src/integrationTest/java/ContractDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java index 9864daed47..e5d6c1b528 100644 --- a/sdk/src/integrationTest/java/ContractDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractCreateTransaction; import com.hedera.hashgraph.sdk.ContractDeleteTransaction; diff --git a/sdk/src/integrationTest/java/ContractExecuteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractExecuteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java index a0e7d6132d..3fd90176e6 100644 --- a/sdk/src/integrationTest/java/ContractExecuteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/integrationTest/java/ContractFunctionParametersIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractFunctionParametersIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java index 88feeb82c9..23976fc949 100644 --- a/sdk/src/integrationTest/java/ContractFunctionParametersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.abi.Address; diff --git a/sdk/src/integrationTest/java/ContractIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java index 2e7163f7f4..6e9cf14978 100644 --- a/sdk/src/integrationTest/java/ContractIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.hedera.hashgraph.sdk.ContractCreateTransaction; diff --git a/sdk/src/integrationTest/java/ContractInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java index 00c1073257..809e256fc2 100644 --- a/sdk/src/integrationTest/java/ContractInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.*; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/integrationTest/java/ContractNonceInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/ContractNonceInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java index 5fcee6c1b4..2973e8f2d5 100644 --- a/sdk/src/integrationTest/java/ContractNonceInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.google.errorprone.annotations.Var; diff --git a/sdk/src/integrationTest/java/ContractUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ContractUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java index 768278268f..53db50adfe 100644 --- a/sdk/src/integrationTest/java/ContractUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractCreateTransaction; import com.hedera.hashgraph.sdk.ContractDeleteTransaction; diff --git a/sdk/src/integrationTest/java/EthereumTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/EthereumTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java index 9e8e7c329d..8ab466df7d 100644 --- a/sdk/src/integrationTest/java/EthereumTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.rlp.RLPEncoder; diff --git a/sdk/src/integrationTest/java/FeeSchedulesTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java similarity index 94% rename from sdk/src/integrationTest/java/FeeSchedulesTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java index 00871eadb2..5c658808e4 100644 --- a/sdk/src/integrationTest/java/FeeSchedulesTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.FeeSchedules; import com.hedera.hashgraph.sdk.FileContentsQuery; diff --git a/sdk/src/integrationTest/java/FileAppendIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/FileAppendIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java index 97a11c4157..d4d02c1bda 100644 --- a/sdk/src/integrationTest/java/FileAppendIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.FileAppendTransaction; import com.hedera.hashgraph.sdk.FileContentsQuery; diff --git a/sdk/src/integrationTest/java/FileContentsIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/FileContentsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java index dd94ae617b..94bcf2612f 100644 --- a/sdk/src/integrationTest/java/FileContentsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.FileContentsQuery; import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileDeleteTransaction; diff --git a/sdk/src/integrationTest/java/FileCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/FileCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java index e0ca9063c3..985f9959eb 100644 --- a/sdk/src/integrationTest/java/FileCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileDeleteTransaction; import com.hedera.hashgraph.sdk.FileInfoQuery; diff --git a/sdk/src/integrationTest/java/FileDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/FileDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java index e8085448b7..7c3779fcf9 100644 --- a/sdk/src/integrationTest/java/FileDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileDeleteTransaction; import com.hedera.hashgraph.sdk.FileInfoQuery; diff --git a/sdk/src/integrationTest/java/FileInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/FileInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java index 20e6dd0713..d056c2986f 100644 --- a/sdk/src/integrationTest/java/FileInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileDeleteTransaction; import com.hedera.hashgraph.sdk.FileInfoQuery; diff --git a/sdk/src/integrationTest/java/FileUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/FileUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java index 27ebfb81e6..42badac4c5 100644 --- a/sdk/src/integrationTest/java/FileUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.FileCreateTransaction; import com.hedera.hashgraph.sdk.FileDeleteTransaction; diff --git a/sdk/src/integrationTest/java/IntegrationTestEnv.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java similarity index 99% rename from sdk/src/integrationTest/java/IntegrationTestEnv.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java index 66902d735f..e00d405844 100644 --- a/sdk/src/integrationTest/java/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import com.google.errorprone.annotations.Var; diff --git a/sdk/src/integrationTest/java/LiveHashAddIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java similarity index 97% rename from sdk/src/integrationTest/java/LiveHashAddIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java index b470f6dda1..2266f08411 100644 --- a/sdk/src/integrationTest/java/LiveHashAddIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.LiveHashAddTransaction; diff --git a/sdk/src/integrationTest/java/LiveHashDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java similarity index 96% rename from sdk/src/integrationTest/java/LiveHashDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java index c77e959e0e..83a274d207 100644 --- a/sdk/src/integrationTest/java/LiveHashDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.LiveHashDeleteTransaction; diff --git a/sdk/src/integrationTest/java/NetworkVersionInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java similarity index 90% rename from sdk/src/integrationTest/java/NetworkVersionInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java index 5a7bf96cea..2e041c3279 100644 --- a/sdk/src/integrationTest/java/NetworkVersionInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.NetworkVersionInfoQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/integrationTest/java/NftAllowancesIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/NftAllowancesIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java index cd412b5686..b2944ac445 100644 --- a/sdk/src/integrationTest/java/NftAllowancesIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/integrationTest/java/NftMetadataGenerator.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java similarity index 94% rename from sdk/src/integrationTest/java/NftMetadataGenerator.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java index 54cf69fab0..34fe908302 100644 --- a/sdk/src/integrationTest/java/NftMetadataGenerator.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/sdk/src/integrationTest/java/ReceiptQueryIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ReceiptQueryIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java index 9eff7b7971..200d05aad3 100644 --- a/sdk/src/integrationTest/java/ReceiptQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/ScheduleCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/ScheduleCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java index 0717c538d5..14e31fa640 100644 --- a/sdk/src/integrationTest/java/ScheduleCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountBalanceQuery; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/sdk/src/integrationTest/java/SystemIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/SystemIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java index 6cadee86f3..425c0e07ea 100644 --- a/sdk/src/integrationTest/java/SystemIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.ContractCreateTransaction; import com.hedera.hashgraph.sdk.ContractFunctionParameters; diff --git a/sdk/src/integrationTest/java/TokenAssociateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAssociateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenAssociateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAssociateIntegrationTest.java index 7008e11d64..748f146019 100644 --- a/sdk/src/integrationTest/java/TokenAssociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAssociateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountId; diff --git a/sdk/src/integrationTest/java/TokenBurnIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenBurnIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java index 9c99e92549..18fb4c4ca7 100644 --- a/sdk/src/integrationTest/java/TokenBurnIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java index 08dcaaa059..91da76e9e7 100644 --- a/sdk/src/integrationTest/java/TokenCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import com.hedera.hashgraph.sdk.AccountId; diff --git a/sdk/src/integrationTest/java/TokenDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/TokenDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java index 5e98cf727f..8556ac27a4 100644 --- a/sdk/src/integrationTest/java/TokenDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.ReceiptStatusException; diff --git a/sdk/src/integrationTest/java/TokenDissociateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenDissociateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java index 7f28a5e55c..4fb10feebf 100644 --- a/sdk/src/integrationTest/java/TokenDissociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenFeeScheduleUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenFeeScheduleUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java index 1fdfd4f907..f6344afb28 100644 --- a/sdk/src/integrationTest/java/TokenFeeScheduleUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.CustomFee; import com.hedera.hashgraph.sdk.CustomFixedFee; diff --git a/sdk/src/integrationTest/java/TokenFreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenFreezeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java index 9d14df2283..d23813f897 100644 --- a/sdk/src/integrationTest/java/TokenFreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenGrantKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenGrantKycIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java index c1d16702e7..27045c89dc 100644 --- a/sdk/src/integrationTest/java/TokenGrantKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java index 1e5dc9b65c..e33bb73761 100644 --- a/sdk/src/integrationTest/java/TokenInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenMintIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenMintIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java index ae95403081..965e769ae7 100644 --- a/sdk/src/integrationTest/java/TokenMintIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenNftInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenNftInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java index 9359aa3e82..18d38dec97 100644 --- a/sdk/src/integrationTest/java/TokenNftInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.NftId; import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.Status; diff --git a/sdk/src/integrationTest/java/TokenNftTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenNftTransferIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java index 2ee5ed349f..f35c2f41d5 100644 --- a/sdk/src/integrationTest/java/TokenNftTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; diff --git a/sdk/src/integrationTest/java/TokenPauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/TokenPauseIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java index c4b5272d82..c6cea240f8 100644 --- a/sdk/src/integrationTest/java/TokenPauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.junit.jupiter.api.Assertions.assertThrows; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/sdk/src/integrationTest/java/TokenRevokeKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenRevokeKycIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java index bb33e0b273..140addea05 100644 --- a/sdk/src/integrationTest/java/TokenRevokeKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenTransferIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java index 0092dc8647..1a54093e19 100644 --- a/sdk/src/integrationTest/java/TokenTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.AccountDeleteTransaction; diff --git a/sdk/src/integrationTest/java/TokenUnfreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenUnfreezeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java index 8aad53d5b2..3fbf052dea 100644 --- a/sdk/src/integrationTest/java/TokenUnfreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TokenUnpauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/TokenUnpauseIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java index 028c324f6a..4fd76a0e21 100644 --- a/sdk/src/integrationTest/java/TokenUnpauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.junit.jupiter.api.Assertions.assertThrows; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/sdk/src/integrationTest/java/TokenUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java index 7156ed0b5b..1cb35baaed 100644 --- a/sdk/src/integrationTest/java/TokenUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/integrationTest/java/TokenUpdateNftsIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenUpdateNftsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java index 55fd853ac6..cc867f0ee2 100644 --- a/sdk/src/integrationTest/java/TokenUpdateNftsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/integrationTest/java/TokenWipeIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TokenWipeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java index 8802abb828..efadb1aad1 100644 --- a/sdk/src/integrationTest/java/TokenWipeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TopicCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java similarity index 96% rename from sdk/src/integrationTest/java/TopicCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java index 7135360467..364cc6ce83 100644 --- a/sdk/src/integrationTest/java/TopicCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.TopicCreateTransaction; import com.hedera.hashgraph.sdk.TopicDeleteTransaction; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/integrationTest/java/TopicDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java similarity index 97% rename from sdk/src/integrationTest/java/TopicDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java index b58f198d07..8d0f93561e 100644 --- a/sdk/src/integrationTest/java/TopicDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.ReceiptStatusException; import com.hedera.hashgraph.sdk.Status; import com.hedera.hashgraph.sdk.TopicCreateTransaction; diff --git a/sdk/src/integrationTest/java/TopicInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TopicInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java index 2994291844..c8afa3a389 100644 --- a/sdk/src/integrationTest/java/TopicInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; import com.hedera.hashgraph.sdk.PrecheckStatusException; diff --git a/sdk/src/integrationTest/java/TopicMessageIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java similarity index 98% rename from sdk/src/integrationTest/java/TopicMessageIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java index adec679c37..94941f9712 100644 --- a/sdk/src/integrationTest/java/TopicMessageIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/integrationTest/java/TopicMessageSubmitIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TopicMessageSubmitIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java index c8b0dbac9d..28c71a747e 100644 --- a/sdk/src/integrationTest/java/TopicMessageSubmitIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.hedera.hashgraph.sdk.PrecheckStatusException; import com.hedera.hashgraph.sdk.ReceiptStatusException; diff --git a/sdk/src/integrationTest/java/TopicUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java similarity index 96% rename from sdk/src/integrationTest/java/TopicUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java index eb85320420..3b9a0f1093 100644 --- a/sdk/src/integrationTest/java/TopicUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.TopicCreateTransaction; import com.hedera.hashgraph.sdk.TopicDeleteTransaction; import com.hedera.hashgraph.sdk.TopicInfoQuery; diff --git a/sdk/src/integrationTest/java/TransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java similarity index 99% rename from sdk/src/integrationTest/java/TransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java index 0c741fb7ad..f2fc03f5d1 100644 --- a/sdk/src/integrationTest/java/TransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.google.errorprone.annotations.Var; import com.google.protobuf.ByteString; import com.hedera.hashgraph.sdk.AccountCreateTransaction; diff --git a/sdk/src/integrationTest/java/TransactionResponseTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java similarity index 95% rename from sdk/src/integrationTest/java/TransactionResponseTest.java rename to sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java index e4ad14ed8b..932171d8df 100644 --- a/sdk/src/integrationTest/java/TransactionResponseTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java @@ -1,3 +1,5 @@ +package com.hedera.hashgraph.sdk.test.integration; + import com.hedera.hashgraph.sdk.AccountCreateTransaction; import com.hedera.hashgraph.sdk.PrivateKey; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java new file mode 100644 index 0000000000..d7d493647e --- /dev/null +++ b/sdk/src/testIntegration/java/module-info.java @@ -0,0 +1,10 @@ +open module com.hedera.hashgraph.sdk.test.integration { + requires com.hedera.hashgraph.sdk; + requires headlong; + requires org.assertj.core; + requires org.bouncycastle.provider; + requires org.junit.jupiter.api; + + requires static com.google.errorprone.annotations; + requires static java.annotation; +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 0075e5d543..0000000000 --- a/settings.gradle +++ /dev/null @@ -1,38 +0,0 @@ -plugins { - id "com.gradle.enterprise" version "3.15.1" -} - -include 'sdk' -include 'tck' -include 'examples' -include 'example-android' - -gradleEnterprise { - buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' - } -} - -var isCiServer = System.getenv().containsKey("CI") -var gradleCacheUsername= System.getenv("GRADLE_CACHE_USERNAME") -var gradleCachePassword = System.getenv("GRADLE_CACHE_PASSWORD") -var gradleCacheAuthorized = - !(gradleCacheUsername?.isEmpty() ?: false) && !(gradleCachePassword?.isEmpty() ?: false) - -buildCache { - remote(HttpBuildCache) { - url = uri("https://cache.gradle.hedera.svcs.eng.swirldslabs.io/cache/") - push = isCiServer && gradleCacheAuthorized - - useExpectContinue = true - enabled = !gradle.startParameter.offline - - if (isCiServer && gradleCacheAuthorized) { - credentials { - username = gradleCacheUsername - password = gradleCachePassword - } - } - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..6ef2b06c8b --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,14 @@ +pluginManagement { + includeBuild("gradle/plugins") +} +plugins { + id("com.hedera.gradle.settings") +} + +includeBuild("examples") +includeBuild("example-android") + +include("sdk") +include("sdk-full") +include("sdk-dependency-versions") +include("tck") diff --git a/tck/build.gradle b/tck/build.gradle deleted file mode 100644 index 91ea3a6255..0000000000 --- a/tck/build.gradle +++ /dev/null @@ -1,45 +0,0 @@ -plugins { - id("com.diffplug.spotless") version "6.25.0" - id 'java' - id 'org.springframework.boot' version '3.2.3' - id 'io.spring.dependency-management' version '1.1.4' -} - -description = "Hedera SDK TCK Server" -group = 'com.hedera.hashgraph.sdk.tck' -version = '0.0.1' - -java { - sourceCompatibility = '17' -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'com.thetransactioncompany:jsonrpc2-server:2.0' - implementation project(':sdk') - compileOnly 'org.projectlombok:lombok:1.18.30' - annotationProcessor 'org.projectlombok:lombok:1.18.30' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' - testImplementation 'org.mockito:mockito-core:3.11.2' - testImplementation 'org.mockito:mockito-junit-jupiter:5.11.0' -} - -spotless { - java { - endWithNewline() - palantirJavaFormat() - target("**/*.java") - toggleOffOn() - } -} - -test { - // discover and execute JUnit5-based tests - useJUnitPlatform() -} diff --git a/tck/build.gradle.kts b/tck/build.gradle.kts new file mode 100644 index 0000000000..a8f1ab7800 --- /dev/null +++ b/tck/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + id("java") + id("com.diffplug.spotless") version "6.25.0" + id("org.springframework.boot") version "3.2.3" +} + +description = "Hedera SDK TCK Server" +group = "com.hedera.hashgraph.sdk.tck" +version = "0.0.1" + +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(platform("org.springframework.boot:spring-boot-dependencies:3.2.3")) + implementation(platform(project(":sdk-dependency-versions"))) + + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("com.thetransactioncompany:jsonrpc2-server:2.0") + implementation(project(":sdk")) + compileOnly("org.projectlombok:lombok:1.18.30") + annotationProcessor("org.projectlombok:lombok:1.18.30") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") + testImplementation("org.mockito:mockito-core:3.11.2") + testImplementation("org.mockito:mockito-junit-jupiter:5.11.0") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") +} + +spotless { + java { + endWithNewline() + palantirJavaFormat() + target("**/*.java") + toggleOffOn() + } +} + +tasks.test { + // discover and execute JUnit5-based tests + useJUnitPlatform() +} diff --git a/version.gradle b/version.gradle deleted file mode 100644 index 19724dbbc9..0000000000 --- a/version.gradle +++ /dev/null @@ -1,5 +0,0 @@ -// For some reason we need to delcare these variables in global scope in both `build.gradle` -// and `sdk/build.gradle` so I extracted them into another file and made both aforementioned -// files import this one. -group = "com.hedera.hashgraph" -version = "2.34.0" diff --git a/version.txt b/version.txt new file mode 100644 index 0000000000..dc1591835c --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +2.34.0