Skip to content

Commit

Permalink
chore: make hapi tests non private (#10446)
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Rader <[email protected]>
  • Loading branch information
kimbor authored Dec 13, 2023
1 parent b2411f9 commit 4db7794
Show file tree
Hide file tree
Showing 276 changed files with 1,338 additions and 1,338 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public List<HapiSpec> getSpecsInSuite() {
});
}

private HapiSpec accountAutoRemoval() {
final HapiSpec accountAutoRemoval() {
String autoRemovedAccount = "autoRemovedAccount";
return defaultHapiSpec("AccountAutoRemoval")
.given(
Expand All @@ -93,7 +93,7 @@ private HapiSpec accountAutoRemoval() {
.then(getAccountBalance(autoRemovedAccount).hasAnswerOnlyPrecheck(INVALID_ACCOUNT_ID));
}

private HapiSpec accountAutoRenewal() {
final HapiSpec accountAutoRenewal() {
final var briefAutoRenew = 3L;
final var autoRenewedAccount = "autoRenewedAccount";

Expand Down Expand Up @@ -130,7 +130,7 @@ private HapiSpec accountAutoRenewal() {
* periods, this test is just a minimal sanity check.
*/
@SuppressWarnings("java:S5960")
private HapiSpec maxNumberOfEntitiesToRenewOrDeleteWorks() {
final HapiSpec maxNumberOfEntitiesToRenewOrDeleteWorks() {
final var briefAutoRenew = 3L;
final var firstTouchable = "a";
final var secondTouchable = "b";
Expand Down Expand Up @@ -185,7 +185,7 @@ private HapiSpec maxNumberOfEntitiesToRenewOrDeleteWorks() {
* <p>If run against a network that has existing funded accounts with very low auto-renew
* periods, this test is just a minimal sanity check.
*/
private HapiSpec numberOfEntitiesToScanWorks() {
final HapiSpec numberOfEntitiesToScanWorks() {
final var briefAutoRenew = 3L;
final int abbrevMaxToScan = 10;
final IntFunction<String> accountName = i -> "fastExpiring" + i;
Expand Down Expand Up @@ -224,7 +224,7 @@ private HapiSpec numberOfEntitiesToScanWorks() {
}));
}

private HapiSpec autoDeleteAfterGracePeriod() {
final HapiSpec autoDeleteAfterGracePeriod() {
final var briefAutoRenew = 3L;
String autoDeleteAccount = "autoDeleteAccount";
return defaultHapiSpec("AutoDeleteAfterGracePeriod")
Expand All @@ -245,14 +245,14 @@ private HapiSpec autoDeleteAfterGracePeriod() {
.then(getAccountBalance(autoDeleteAccount).hasAnswerOnlyPrecheck(INVALID_ACCOUNT_ID));
}

private HapiSpec accountAutoRenewalSuiteCleanup() {
final HapiSpec accountAutoRenewalSuiteCleanup() {
return defaultHapiSpec("accountAutoRenewalSuiteCleanup")
.given()
.when()
.then(fileUpdate(APP_PROPERTIES).payingWith(GENESIS).overridingProps(disablingAutoRenewWithDefaults()));
}

private HapiSpec freezeAtTheEnd() {
final HapiSpec freezeAtTheEnd() {
return defaultHapiSpec("freezeAtTheEnd")
.given()
.when(freezeOnly().startingIn(30).seconds().payingWith(GENESIS))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public List<HapiSpec> getSpecsInSuite() {
});
}

private HapiSpec ignoresExpiredDeletedContracts() {
final HapiSpec ignoresExpiredDeletedContracts() {
final var adminKey = "tac";
final var tbd = "dead";

Expand All @@ -79,7 +79,7 @@ private HapiSpec ignoresExpiredDeletedContracts() {
.then(getContractInfo(tbd).hasCostAnswerPrecheck(INVALID_CONTRACT_ID));
}

private HapiSpec immediatelyRemovesDeletedAccountOnExpiry() {
final HapiSpec immediatelyRemovesDeletedAccountOnExpiry() {
final var tbd = "dead";
final var onlyDetached = "gone";

Expand All @@ -95,7 +95,7 @@ private HapiSpec immediatelyRemovesDeletedAccountOnExpiry() {
.then(getAccountInfo(onlyDetached), getAccountInfo(tbd).hasCostAnswerPrecheck(INVALID_ACCOUNT_ID));
}

private HapiSpec displacesTokenUnitsAsExpected() {
final HapiSpec displacesTokenUnitsAsExpected() {
final long startSupply = 10;
final long displacedSupply = 1;
final var adminKey = "tak";
Expand Down Expand Up @@ -137,7 +137,7 @@ private HapiSpec displacesTokenUnitsAsExpected() {
.hasTokenBalance(anotherLiveToken, startSupply));
}

private HapiSpec autoRemovalCasesSuiteCleanup() {
final HapiSpec autoRemovalCasesSuiteCleanup() {
return defaultHapiSpec("AutoRemovalCasesSuiteCleanup")
.given()
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public List<HapiSpec> getSpecsInSuite() {
verifyNonFungibleTokenTransferredBackToTreasuryWithoutCharging());
}

private HapiSpec renewalWithCustomFeesWorks() {
final HapiSpec renewalWithCustomFeesWorks() {
final var minimalLifetime = 4;
final var aFungibleToken = "aFT";
final var bFungibleToken = "bFT";
Expand Down Expand Up @@ -175,7 +175,7 @@ private HapiSpec renewalWithCustomFeesWorks() {
getTokenNftInfo(nonFungibleToken, 2L).hasAccountID(TOKEN_TREASURY));
}

private HapiSpec receiverSigReqBypassedForTreasuryAtEndOfGracePeriod() {
final HapiSpec receiverSigReqBypassedForTreasuryAtEndOfGracePeriod() {
final var minimalLifetime = 4;
final var aFungibleToken = "aFT";
final var nonFungibleToken = "NFT";
Expand Down Expand Up @@ -242,14 +242,14 @@ private HapiSpec receiverSigReqBypassedForTreasuryAtEndOfGracePeriod() {
getTokenNftInfo(nonFungibleToken, 2L).hasAccountID(TOKEN_TREASURY));
}

private HapiSpec validateStreams() {
final HapiSpec validateStreams() {
return defaultHapiSpec("validateStreams")
.given()
.when()
.then(sourcing(() -> assertEventuallyPasses(new ExpiryRecordsValidator(), Duration.ofMillis(2_100))));
}

private HapiSpec storageRentChargedOnlyAfterInitialFreePeriodIsComplete() {
final HapiSpec storageRentChargedOnlyAfterInitialFreePeriodIsComplete() {
final var contract = "User";
final var gasToOffer = 1_000_000;
final var minimalLifetime = 4;
Expand Down Expand Up @@ -338,7 +338,7 @@ private HapiSpec storageRentChargedOnlyAfterInitialFreePeriodIsComplete() {
overriding(INDIVIDUAL_KV_LIMIT_PROP, String.valueOf(16_384_000)));
}

private HapiSpec autoRenewWorksAsExpected() {
final HapiSpec autoRenewWorksAsExpected() {
final var minimalLifetime = 3;

return defaultHapiSpec("autoRenewWorksAsExpected")
Expand Down Expand Up @@ -386,7 +386,7 @@ private HapiSpec autoRenewWorksAsExpected() {
overriding(LEDGER_AUTO_RENEW_PERIOD_MIN_DURATION, DEFAULT_MIN_AUTO_RENEW_PERIOD));
}

private HapiSpec autoRenewInGracePeriodIfEnoughBalance() {
final HapiSpec autoRenewInGracePeriodIfEnoughBalance() {
final var minimalLifetime = 3;
final var expectedExpiryPostRenew = new AtomicLong();
final var currentExpiry = new AtomicLong();
Expand Down Expand Up @@ -446,7 +446,7 @@ private HapiSpec autoRenewInGracePeriodIfEnoughBalance() {
overriding(LEDGER_AUTO_RENEW_PERIOD_MIN_DURATION, DEFAULT_MIN_AUTO_RENEW_PERIOD));
}

private HapiSpec renewalFeeDistributedToStakingAccounts() {
final HapiSpec renewalFeeDistributedToStakingAccounts() {
final var initBalance = ONE_HBAR;
final var minimalLifetime = 3;
final var standardLifetime = 7776000L;
Expand Down Expand Up @@ -519,7 +519,7 @@ private HapiSpec renewalFeeDistributedToStakingAccounts() {
overriding(LEDGER_AUTO_RENEW_PERIOD_MIN_DURATION, DEFAULT_MIN_AUTO_RENEW_PERIOD));
}

private HapiSpec chargesContractFundsWhenAutoRenewAccountHasZeroBalance() {
final HapiSpec chargesContractFundsWhenAutoRenewAccountHasZeroBalance() {
final var initBalance = ONE_HBAR;
final var minimalLifetime = 3;
final var standardLifetime = 7776000L;
Expand Down Expand Up @@ -587,7 +587,7 @@ private HapiSpec chargesContractFundsWhenAutoRenewAccountHasZeroBalance() {
overriding(LEDGER_AUTO_RENEW_PERIOD_MIN_DURATION, DEFAULT_MIN_AUTO_RENEW_PERIOD));
}

private HapiSpec renewsUsingAutoRenewAccountIfSet() {
final HapiSpec renewsUsingAutoRenewAccountIfSet() {
final var initBalance = ONE_HBAR;
final var minimalLifetime = 3;
final var standardLifetime = 7776000L;
Expand Down Expand Up @@ -654,7 +654,7 @@ private HapiSpec renewsUsingAutoRenewAccountIfSet() {
overriding(LEDGER_AUTO_RENEW_PERIOD_MIN_DURATION, DEFAULT_MIN_AUTO_RENEW_PERIOD));
}

private HapiSpec storageExpiryWorksAtTheExpectedInterval() {
final HapiSpec storageExpiryWorksAtTheExpectedInterval() {
final var minimalLifetime = 4;
final var aFungibleToken = "aFT";
final var bFungibleToken = "bFT";
Expand Down Expand Up @@ -748,7 +748,7 @@ private HapiSpec storageExpiryWorksAtTheExpectedInterval() {
getAccountBalance(TOKEN_TREASURY).hasTinyBars(ONE_HBAR));
}

private HapiSpec verifyNonFungibleTokenTransferredBackToTreasuryWithoutCharging() {
final HapiSpec verifyNonFungibleTokenTransferredBackToTreasuryWithoutCharging() {
final var minimalLifetime = 4;
final var nonFungibleToken = "NFT";
final var initBalance = ONE_HBAR;
Expand Down Expand Up @@ -801,7 +801,7 @@ private HapiSpec verifyNonFungibleTokenTransferredBackToTreasuryWithoutCharging(
getAccountBalance(TOKEN_TREASURY).hasTinyBars(ONE_HBAR));
}

private HapiSpec renewsUsingContractFundsIfNoAutoRenewAccount() {
final HapiSpec renewsUsingContractFundsIfNoAutoRenewAccount() {
final var initBalance = ONE_HBAR;
final var minimalLifetime = 3;
final var standardLifetime = 7776000L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public List<HapiSpec> getSpecsInSuite() {
gracePeriodRestrictionsSuiteCleanup());
}

private HapiSpec contractCallRestrictionsEnforced() {
final HapiSpec contractCallRestrictionsEnforced() {
final var civilian = "misc";
final var detachedAccount = "gone";
final var contract = "DoubleSend";
Expand Down Expand Up @@ -134,7 +134,7 @@ contract, getABIFor(FUNCTION, "donate", contract), new Object[] {
getAccountBalance(detachedAccount).hasTinyBars(1L));
}

private HapiSpec cryptoUpdateRestrictionsEnforced() {
final HapiSpec cryptoUpdateRestrictionsEnforced() {
final var detachedAccount = "gone";
final long certainlyPast = Instant.now().getEpochSecond() - THREE_MONTHS_IN_SECONDS;
final long certainlyDistant = Instant.now().getEpochSecond() + THREE_MONTHS_IN_SECONDS;
Expand Down Expand Up @@ -177,7 +177,7 @@ private HapiSpec cryptoUpdateRestrictionsEnforced() {
.hasKnownStatus(EXPIRATION_REDUCTION_NOT_ALLOWED));
}

private HapiSpec payerRestrictionsEnforced() {
final HapiSpec payerRestrictionsEnforced() {
final var detachedAccount = "gone";

return defaultHapiSpec("PayerRestrictionsEnforced")
Expand All @@ -199,7 +199,7 @@ private HapiSpec payerRestrictionsEnforced() {
.hasKnownStatus(ACCOUNT_EXPIRED_AND_PENDING_REMOVAL));
}

private HapiSpec topicAutoRenewOpsEnforced() {
final HapiSpec topicAutoRenewOpsEnforced() {
final var topicWithDetachedAsAutoRenew = "c";
final var topicSansDetachedAsAutoRenew = "d";
final var detachedAccount = "gone";
Expand Down Expand Up @@ -236,7 +236,7 @@ private HapiSpec topicAutoRenewOpsEnforced() {
getTopicInfo(topicWithDetachedAsAutoRenew).hasAutoRenewAccount(detachedAccount));
}

private HapiSpec tokenAutoRenewOpsEnforced() {
final HapiSpec tokenAutoRenewOpsEnforced() {
final var tokenWithDetachedAsAutoRenew = "c";
final var tokenSansDetachedAsAutoRenew = "d";
final var detachedAccount = "gone";
Expand Down Expand Up @@ -272,7 +272,7 @@ private HapiSpec tokenAutoRenewOpsEnforced() {
getTokenInfo(tokenWithDetachedAsAutoRenew).hasAutoRenewAccount(detachedAccount));
}

private HapiSpec treasuryOpsRestrictionEnforced() {
final HapiSpec treasuryOpsRestrictionEnforced() {
final var aToken = "c";
final var detachedAccount = "gone";
final var tokenMultiKey = "tak";
Expand Down Expand Up @@ -301,7 +301,7 @@ private HapiSpec treasuryOpsRestrictionEnforced() {
getAccountBalance(detachedAccount).hasTokenBalance(aToken, expectedSupply));
}

private HapiSpec tokenMgmtRestrictionsEnforced() {
final HapiSpec tokenMgmtRestrictionsEnforced() {
final var notToBe = "a";
final var tokenNotYetAssociated = "b";
final var tokenAlreadyAssociated = "c";
Expand Down Expand Up @@ -345,7 +345,7 @@ private HapiSpec tokenMgmtRestrictionsEnforced() {
.hasKnownStatus(ACCOUNT_EXPIRED_AND_PENDING_REMOVAL));
}

private HapiSpec cryptoAndContractDeleteRestrictionsEnforced() {
final HapiSpec cryptoAndContractDeleteRestrictionsEnforced() {
final var detachedAccount = "gone";
final var civilian = "misc";
final var tbd = "contract";
Expand All @@ -372,7 +372,7 @@ private HapiSpec cryptoAndContractDeleteRestrictionsEnforced() {
.hasKnownStatus(ACCOUNT_EXPIRED_AND_PENDING_REMOVAL));
}

private HapiSpec cryptoTransferRestrictionsEnforced() {
final HapiSpec cryptoTransferRestrictionsEnforced() {
final var aToken = "c";
final var detachedAccount = "gone";
final var civilian = "misc";
Expand All @@ -395,7 +395,7 @@ private HapiSpec cryptoTransferRestrictionsEnforced() {
.hasKnownStatus(ACCOUNT_EXPIRED_AND_PENDING_REMOVAL));
}

private HapiSpec gracePeriodRestrictionsSuiteSetup() {
final HapiSpec gracePeriodRestrictionsSuiteSetup() {
return defaultHapiSpec("GracePeriodRestrictionsSuiteSetup")
.given()
.when()
Expand All @@ -404,7 +404,7 @@ private HapiSpec gracePeriodRestrictionsSuiteSetup() {
.overridingProps(propsForAccountAutoRenewOnWith(1, 3600)));
}

private HapiSpec gracePeriodRestrictionsSuiteCleanup() {
final HapiSpec gracePeriodRestrictionsSuiteCleanup() {
return defaultHapiSpec("GracePeriodRestrictionsSuiteCleanup")
.given()
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public List<HapiSpec> getSpecsInSuite() {
}

@SuppressWarnings("java:S125")
private HapiSpec renewalCappedByAffordablePeriod() {
final HapiSpec renewalCappedByAffordablePeriod() {
final long briefAutoRenew = 10L;
final long normalAutoRenew = THREE_MONTHS_IN_SECONDS;
final long threeHoursInSeconds = 3 * 3600L;
Expand Down Expand Up @@ -130,7 +130,7 @@ private HapiSpec renewalCappedByAffordablePeriod() {
}

@SuppressWarnings("java:S5960")
private HapiSpec feesChargedMatchNumberOfRenewals() {
final HapiSpec feesChargedMatchNumberOfRenewals() {
final long reqAutoRenew = 2L;
final long startBalance = ONE_HUNDRED_HBARS;
final var target = "czar";
Expand Down Expand Up @@ -229,7 +229,7 @@ private RenewalFeeComponents autoRenewFeesFor(final HapiSpec spec, final ExtantC
return new RenewalFeeComponents(inTinybars(constantPrice, rates), inTinybars(variablePrice, rates));
}

private HapiSpec macroFeesChargedSanityCheckSuiteCleanup() {
final HapiSpec macroFeesChargedSanityCheckSuiteCleanup() {
return defaultHapiSpec("MacroFeesChargedSanityCheckSuiteCleanup")
.given()
.when()
Expand Down
Loading

0 comments on commit 4db7794

Please sign in to comment.