Skip to content

Add comprehensive test suite for duplicate identifier bug fix#4

Open
adamjohnwright wants to merge 1 commit into
mainfrom
feature/add-duplicate-identifier-tests
Open

Add comprehensive test suite for duplicate identifier bug fix#4
adamjohnwright wants to merge 1 commit into
mainfrom
feature/add-duplicate-identifier-tests

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

This commit adds a complete test suite to validate the duplicate identifier bug fix implemented in PR #3. The tests ensure that the fix prevents duplicate identifiers from being created when isoforms and canonical proteins share the same dbId.

Tests Added:

  • ReferenceCreatorTest: Tests core duplicate prevention mechanisms

    • dbId-based mapping vs object identity (main bug fix)
    • In-memory CSV deduplication using Set
    • Relationship line creation for all source mappings
    • Multiple run duplicate prevention
  • DatabaseIdentifierReferenceCreatorTest: Tests DatabaseIdentifier caching

    • fetchOrCreate pattern validation
    • Cache isolation by ReferenceDatabase
    • No duplicate objects in memory
  • ReferenceSequenceReferenceCreatorTest: Tests ReferenceSequence caching

    • Reference sequence creation and caching
    • Cache behavior documentation
    • Multiple sources sharing identifiers
  • DuplicatePreventionIntegrationTest: End-to-end integration tests

    • Simulates exact bug scenario (isoforms with same dbId)
    • Multiple sources with shared external identifiers
    • Complete workflow validation

Infrastructure Improvements:

  • Migrate to JUnit 5.9.3 from outdated milestone version
  • Update Mockito to 4.11.0 with JUnit 5 integration
  • Add maven-surefire-plugin 2.22.2 for proper JUnit 5 support
  • Add comprehensive TEST_README.md documentation

Test Coverage:

  • 4 test classes
  • 17 test methods
  • Covers dbId mapping, CSV deduplication, caching, and integration scenarios

Related to PR #3: bug-fix/duplicate-identifiers

🤖 Generated with Claude Code

This commit adds a complete test suite to validate the duplicate identifier
bug fix implemented in PR #3. The tests ensure that the fix prevents duplicate
identifiers from being created when isoforms and canonical proteins share the
same dbId.

Tests Added:
- ReferenceCreatorTest: Tests core duplicate prevention mechanisms
  * dbId-based mapping vs object identity (main bug fix)
  * In-memory CSV deduplication using Set
  * Relationship line creation for all source mappings
  * Multiple run duplicate prevention

- DatabaseIdentifierReferenceCreatorTest: Tests DatabaseIdentifier caching
  * fetchOrCreate pattern validation
  * Cache isolation by ReferenceDatabase
  * No duplicate objects in memory

- ReferenceSequenceReferenceCreatorTest: Tests ReferenceSequence caching
  * Reference sequence creation and caching
  * Cache behavior documentation
  * Multiple sources sharing identifiers

- DuplicatePreventionIntegrationTest: End-to-end integration tests
  * Simulates exact bug scenario (isoforms with same dbId)
  * Multiple sources with shared external identifiers
  * Complete workflow validation

Infrastructure Improvements:
- Migrate to JUnit 5.9.3 from outdated milestone version
- Update Mockito to 4.11.0 with JUnit 5 integration
- Add maven-surefire-plugin 2.22.2 for proper JUnit 5 support
- Add comprehensive TEST_README.md documentation

Test Coverage:
- 4 test classes
- 17 test methods
- Covers dbId mapping, CSV deduplication, caching, and integration scenarios

Related to PR #3: bug-fix/duplicate-identifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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