Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contract test for UserIdentifier #1463

Open
ruspl-afed opened this issue Nov 13, 2024 · 0 comments
Open

Add contract test for UserIdentifier #1463

ruspl-afed opened this issue Nov 13, 2024 · 0 comments
Milestone

Comments

@ruspl-afed
Copy link
Contributor

Extracted from #1454 (review) by @eparovyshnaya

UserIdentifier interface is used by core, among other ways, as a key to HashMaps.
This usage lies obligations on this interface (hashCode() and equals() impls should be in synch).

The only implementation of this interface is record, so it meets the requirement automatically. But custom implementations of Access Cycle Configuration services can potentially supply their own implementation for UserIdentifier interface as well.

This means that there should be a contract test for this interface.

We rely on UserIdentifier implementation to

  • do not tolerate null as construction input
  • have synchronous equals() and hashCode(), meaning different instances, constructed with equal strings, beget true for equals() and have the same hashCode().

This contract test must be implemented for BaseUserIdentifier.

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

No branches or pull requests

1 participant