-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Unstable key generation with provider states #1717
- Loading branch information
1 parent
c6efac9
commit 5d29116
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package au.com.dius.pact.core.model | ||
|
||
import spock.lang.Issue | ||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
|
@@ -41,4 +42,21 @@ class ProviderStateSpec extends Specification { | |
state1.uniqueKey() != state3.uniqueKey() | ||
state1.uniqueKey() != state4.uniqueKey() | ||
} | ||
|
||
@Issue("#1717") | ||
def 'uniqueKey should be deterministic'() { | ||
given: | ||
def state = new ProviderState('a user profile exists', [ | ||
email_address: '[email protected]', | ||
family_name: 'Test' | ||
]) | ||
def state2 = new ProviderState('a user profile exists', [ | ||
family_name: 'Test', | ||
email_address: '[email protected]' | ||
]) | ||
|
||
expect: | ||
state.uniqueKey() == state.uniqueKey() | ||
state.uniqueKey() == state2.uniqueKey() | ||
} | ||
} |