1- /* ktlint-disable max-line-length */
1+
22package dev.openfeature.kotlin.sdk.e2e
33
44import dev.openfeature.kotlin.sdk.Client
55import dev.openfeature.kotlin.sdk.EvaluationContext
6+ import dev.openfeature.kotlin.sdk.FlagEvaluationDetails
67import dev.openfeature.kotlin.sdk.OpenFeatureAPI
78import dev.openfeature.kotlin.sdk.Reason
89import dev.openfeature.kotlin.sdk.Value
@@ -20,8 +21,11 @@ class EvaluationSteps {
2021 @Given(" a stable provider" )
2122 fun setup (): Unit = runBlocking {
2223 val flags = mapOf (
23- " boolean-flag" to Flag .builder<Boolean >().variant(" on" , true ).variant(" off" , false ).defaultVariant(" on" ).build(),
24- " string-flag" to Flag .builder<String >().variant(" greeting" , " hi" ).defaultVariant(" greeting" ).build(),
24+ " boolean-flag" to
25+ Flag .builder<Boolean >().variant(" on" , true )
26+ .variant(" off" , false ).defaultVariant(" on" ).build(),
27+ " string-flag" to
28+ Flag .builder<String >().variant(" greeting" , " hi" ).defaultVariant(" greeting" ).build(),
2529 " integer-flag" to Flag .builder<Int >().variant(" ten" , 10 ).defaultVariant(" ten" ).build(),
2630 " float-flag" to Flag .builder<Double >().variant(" half" , 0.5 ).defaultVariant(" half" ).build(),
2731 " object-flag" to Flag .builder<Value >().variant(
@@ -59,11 +63,11 @@ class EvaluationSteps {
5963 private var doubleFlagValue: Double = 0.0
6064 private var objectFlagValue: Value ? = null
6165
62- private var booleanFlagDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <Boolean >? = null
63- private var stringFlagDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <String >? = null
64- private var intFlagDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <Int >? = null
65- private var doubleFlagDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <Double >? = null
66- private var objectFlagDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <Value >? = null
66+ private var booleanFlagDetails: FlagEvaluationDetails <Boolean >? = null
67+ private var stringFlagDetails: FlagEvaluationDetails <String >? = null
68+ private var intFlagDetails: FlagEvaluationDetails <Int >? = null
69+ private var doubleFlagDetails: FlagEvaluationDetails <Double >? = null
70+ private var objectFlagDetails: FlagEvaluationDetails <Value >? = null
6771
6872 private var contextAwareFlagKey: String = " "
6973 private var contextAwareDefaultValue: String = " "
@@ -72,11 +76,11 @@ class EvaluationSteps {
7276
7377 private var notFoundFlagKey: String = " "
7478 private var notFoundDefaultValue: String = " "
75- private var notFoundDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <String >? = null
79+ private var notFoundDetails: FlagEvaluationDetails <String >? = null
7680
7781 private var typeErrorFlagKey: String = " "
7882 private var typeErrorDefaultValue: Int = 0
79- private var typeErrorDetails: dev.openfeature.kotlin.sdk. FlagEvaluationDetails <Int >? = null
83+ private var typeErrorDetails: FlagEvaluationDetails <Int >? = null
8084
8185 @When(" a boolean flag with key {string} is evaluated with default value {string}" )
8286 fun evaluate_boolean (flagKey : String , defaultValue : String ) {
@@ -124,7 +128,8 @@ class EvaluationSteps {
124128 }
125129
126130 @Then(
127- " the resolved object value should be contain fields {string}, {string}, and {string}, with values {string}, {string} and {int}, respectively"
131+ " the resolved object value should be contain fields {string}, {string}, and {string}, " +
132+ " with values {string}, {string} and {int}, respectively"
128133 )
129134 fun assert_object_value (
130135 boolField : String ,
@@ -146,7 +151,8 @@ class EvaluationSteps {
146151 }
147152
148153 @Then(
149- " the resolved boolean details value should be {string}, the variant should be {string}, and the reason should be {string}"
154+ " the resolved boolean details value should be {string}, " +
155+ " the variant should be {string}, and the reason should be {string}"
150156 )
151157 fun assert_boolean_details (expectedValue : String , expectedVariant : String , expectedReason : String ) {
152158 assertEquals(expectedValue.toBoolean(), booleanFlagDetails?.value)
@@ -160,7 +166,8 @@ class EvaluationSteps {
160166 }
161167
162168 @Then(
163- " the resolved string details value should be {string}, the variant should be {string}, and the reason should be {string}"
169+ " the resolved string details value should be {string}, the variant should be {string}, " +
170+ " and the reason should be {string}"
164171 )
165172 fun assert_string_details (expectedValue : String , expectedVariant : String , expectedReason : String ) {
166173 assertEquals(expectedValue, stringFlagDetails?.value)
@@ -174,7 +181,8 @@ class EvaluationSteps {
174181 }
175182
176183 @Then(
177- " the resolved integer details value should be {int}, the variant should be {string}, and the reason should be {string}"
184+ " the resolved integer details value should be {int}, " +
185+ " the variant should be {string}, and the reason should be {string}"
178186 )
179187 fun assert_integer_details (expectedValue : Int , expectedVariant : String , expectedReason : String ) {
180188 assertEquals(expectedValue, intFlagDetails?.value)
@@ -188,7 +196,8 @@ class EvaluationSteps {
188196 }
189197
190198 @Then(
191- " the resolved float details value should be {double}, the variant should be {string}, and the reason should be {string}"
199+ " the resolved float details value should be {double}, the variant should be {string}, " +
200+ " and the reason should be {string}"
192201 )
193202 fun assert_double_details (expectedValue : Double , expectedVariant : String , expectedReason : String ) {
194203 assertEquals(expectedValue, doubleFlagDetails?.value)
@@ -202,7 +211,8 @@ class EvaluationSteps {
202211 }
203212
204213 @Then(
205- " the resolved object details value should be contain fields {string}, {string}, and {string}, with values {string}, {string} and {int}, respectively"
214+ " the resolved object details value should be contain fields {string}, {string}, and {string}, " +
215+ " with values {string}, {string} and {int}, respectively"
206216 )
207217 fun assert_object_details (
208218 boolField : String ,
0 commit comments