Skip to content

Add identity test for EnumIvoryTower single#3470

Open
ZachT01 wants to merge 1 commit intoiluwatar:masterfrom
ZachT01:master
Open

Add identity test for EnumIvoryTower single#3470
ZachT01 wants to merge 1 commit intoiluwatar:masterfrom
ZachT01:master

Conversation

@ZachT01
Copy link
Copy Markdown

@ZachT01 ZachT01 commented May 1, 2026

This pull request adds a new JUnit test verifying that EnumIvoryTower.INSTANCE
returns the same instance on repeated access. This improves test coverage for
the Enum-based singleton implementation.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

PR Summary

Added a new JUnit test to verify that EnumIvoryTower.INSTANCE returns the same instance on repeated access, reinforcing the Enum-based singleton behavior. The test imports assertSame and runs alongside the existing reflection-based test to ensure the constructor cannot be invoked reflectively.

Changes

File Summary
singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java Added an identity test verifying singleton nature of EnumIvoryTower.INSTANCE by asserting reference equality; updated imports to include assertSame; preserves existing reflection test.

autogenerated by presubmit.ai

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 54d96a8: Add identity test for EnumIvoryTower single
Files Processed (1)
  • singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java (2 hunks)
Actionable Comments (0)
Skipped Comments (2)
  • singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java [29-29]

    best_practice: "Import for new assertion"

  • singleton/src/test/java/com/iluwatar/singleton/EnumIvoryTowerTest.java [51-56]

    enhancement: "Verify enum singleton identity test"

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