-
Notifications
You must be signed in to change notification settings - Fork 86
Thread allocationKey into ResolutionDetails flagMetadata #3534
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
Changes from 8 commits
515f8c4
50de9b0
3ca40b9
cfa979d
535077e
78020e9
658837b
669747a
3aafb4b
b0593c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -135,6 +135,25 @@ internal class ConvertersTest { | |||||
| assertThat(result.reason).isEqualTo("ERROR") | ||||||
| } | ||||||
|
|
||||||
| @Test | ||||||
| fun `M surface allocationKey in metadata W toProviderEvaluation() {flagMetadata contains allocationKey}`( | ||||||
| @BoolForgery fakeValue: Boolean, | ||||||
| @StringForgery fakeAllocationKey: String | ||||||
| ) { | ||||||
| // Given | ||||||
| val resolution = ResolutionDetails( | ||||||
| value = fakeValue, | ||||||
| reason = ResolutionReason.TARGETING_MATCH, | ||||||
| flagMetadata = mapOf("allocationKey" to fakeAllocationKey) | ||||||
| ) | ||||||
|
|
||||||
| // When | ||||||
| val result = resolution.toProviderEvaluation() | ||||||
|
|
||||||
| // Then | ||||||
| assertThat(result.metadata?.getString("allocationKey")).isEqualTo(fakeAllocationKey) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fails CI due to metadata is non-null
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| // endregion | ||||||
|
|
||||||
| // region toOpenFeatureErrorCode | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: do we not need to worry about Long with builder.putLong? https://github.com/open-feature/kotlin-sdk/blob/cfe7ac44d92aef0366e4e6cb8bd01ce070ea06d7/kotlin-sdk/src/commonMain/kotlin/dev/openfeature/kotlin/sdk/FlagEvaluationMetadata.kt#L48