test(framework): consolidate and stabilize CredentialsTest#6614
Open
3for wants to merge 2 commits intotronprotocol:developfrom
Open
test(framework): consolidate and stabilize CredentialsTest#66143for wants to merge 2 commits intotronprotocol:developfrom
3for wants to merge 2 commits intotronprotocol:developfrom
Conversation
Consolidate the misplaced keystroe CredentialsTest into org.tron.keystore.CredentialsTest. - remove the duplicate test under the misspelled keystroe package - add explicit equals behavior coverage for address and cryptoEngine - normalize assertions to JUnit Assert and remove legacy TestCase usage
Replace random Credentials test setup with deterministic SignInterface mocks so the suite no longer depends on platform-specific SecureRandom providers or probabilistic retries. - remove NativePRNG usage from CredentialsTest - replace random key generation with fixed address fixtures via mocked SignInterface - assert create(SignInterface) returns the expected base58check address - keep equals/hashCode contract coverage with deterministic inputs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR cleans up and consolidates
CredentialsTestcoverage in theframeworkmodule.org.tron.keystroeorg.tron.keystoreSignInterfacefixturesCredentials.create(...),equals(...), andhashCode()Why are these changes required?
The previous test setup had two problems:
This change makes the test deterministic, easier to understand, and better aligned with the current
Credentialscontract:addressis derived fromgetAddress()cryptoEngineandaddresshashCodeThis PR has been tested by:
./gradlew framework:test --tests org.tron.keystore.CredentialsTestFollow up
No follow-up is required.
Extra details
This is a test-only change. No production logic, protocol behavior, or runtime code path is modified.