Skip to content

test: make B2Json Container.equals check all fields and test the version-range upper bound - #229

Open
ffumero2003 wants to merge 1 commit into
masterfrom
test-b2json-container-equals-and-version-range
Open

ffumero2003 wants to merge 1 commit into
masterfrom
test-b2json-container-equals-and-version-range

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

Two test-quality gaps in B2JsonTest.

Changes

  • Container.equals/hashCode now include the d field. The test helper's equals compared only a and b, so a round-trip test of escaped names (@d) was vacuous — two Containers differing only in d were "equal". The escaped-name test now asserts the decoded d directly and that a Container differing only in d is unequal.
  • The version-range upper bound is now exercised. The "Version 6 is the last" block reused setVersion(4), so version 6 was never tested; it now uses setVersion(6).

Verification

./gradlew :b2-sdk-core:test --tests com.backblaze.b2.json.B2JsonTest passes; the full build passes. Reverting Container.equals to ignore d makes the escaped-name test fail; restoring it passes.

…ion-range upper bound

Compare the serialized-name field during Container equality checks and provide a matching hash code.

Exercise version 6 in the version-range upper-bound case.
@ffumero2003 ffumero2003 self-assigned this Nov 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant