@@ -236,6 +236,7 @@ void should_throw_an_error_if_endpoint_not_available() {
236
236
FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("fail_500" , false , this .evaluationContext );
237
237
FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
238
238
.value (false )
239
+ .flagKey ("fail_500" )
239
240
.reason (Reason .ERROR .name ())
240
241
.errorCode (ErrorCode .GENERAL )
241
242
.errorMessage ("unknown error while retrieving flag fail_500" )
@@ -257,6 +258,7 @@ void should_throw_an_error_if_invalid_api_key() {
257
258
FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("fail_401" , false , this .evaluationContext );
258
259
FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
259
260
.value (false )
261
+ .flagKey ("fail_401" )
260
262
.reason (Reason .ERROR .name ())
261
263
.errorCode (ErrorCode .GENERAL )
262
264
.errorMessage ("authentication/authorization error" )
@@ -277,6 +279,7 @@ void should_throw_an_error_if_flag_does_not_exists() {
277
279
FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("flag_not_found" , false , this .evaluationContext );
278
280
FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
279
281
.value (false )
282
+ .flagKey ("flag_not_found" )
280
283
.reason (Reason .ERROR .name ())
281
284
.errorCode (ErrorCode .FLAG_NOT_FOUND )
282
285
.errorMessage ("Flag flag_not_found was not found in your configuration" )
@@ -297,6 +300,7 @@ void should_throw_an_error_if_we_expect_a_boolean_and_got_another_type() {
297
300
FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("string_key" , false , this .evaluationContext );
298
301
FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
299
302
.value (false )
303
+ .flagKey ("string_key" )
300
304
.reason (Reason .ERROR .name ())
301
305
.errorCode (ErrorCode .TYPE_MISMATCH )
302
306
.errorMessage (
@@ -515,6 +519,7 @@ void should_throw_an_error_if_we_expect_a_string_and_got_another_type() {
515
519
client .getStringDetails ("bool_targeting_match" , "defaultValue" , this .evaluationContext );
516
520
FlagEvaluationDetails <String > want = FlagEvaluationDetails .<String >builder ()
517
521
.value ("defaultValue" )
522
+ .flagKey ("bool_targeting_match" )
518
523
.reason (Reason .ERROR .name ())
519
524
.errorMessage (
520
525
"Flag value bool_targeting_match had unexpected type class java.lang.Boolean, expected class java.lang.String." )
@@ -579,6 +584,7 @@ void should_throw_an_error_if_we_expect_a_integer_and_got_another_type() {
579
584
client .getIntegerDetails ("bool_targeting_match" , 200 , this .evaluationContext );
580
585
FlagEvaluationDetails <Integer > want = FlagEvaluationDetails .<Integer >builder ()
581
586
.value (200 )
587
+ .flagKey ("bool_targeting_match" )
582
588
.reason (Reason .ERROR .name ())
583
589
.errorMessage (
584
590
"Flag value bool_targeting_match had unexpected type class java.lang.Boolean, expected class java.lang.Integer." )
@@ -641,6 +647,7 @@ void should_throw_an_error_if_we_expect_a_integer_and_double_type() {
641
647
FlagEvaluationDetails <Integer > got = client .getIntegerDetails ("double_key" , 200 , this .evaluationContext );
642
648
FlagEvaluationDetails <Integer > want = FlagEvaluationDetails .<Integer >builder ()
643
649
.value (200 )
650
+ .flagKey ("double_key" )
644
651
.reason (Reason .ERROR .name ())
645
652
.errorMessage (
646
653
"Flag value double_key had unexpected type class java.lang.Double, expected class java.lang.Integer." )
@@ -727,8 +734,10 @@ void should_resolve_a_valid_value_flag_with_TARGETING_MATCH_reason() {
727
734
.value (new Value (new MutableStructure ()
728
735
.add ("test" , "test1" )
729
736
.add ("test2" , false )
737
+ .add ("test5" , new Value ())
730
738
.add ("test3" , 123.3 )
731
739
.add ("test4" , 1 )))
740
+ .flagKey ("object_key" )
732
741
.reason (Reason .TARGETING_MATCH .name ())
733
742
.variant ("True" )
734
743
.flagMetadata (defaultMetadata )
@@ -772,6 +781,7 @@ void should_throw_an_error_if_no_targeting_key() {
772
781
client .getObjectDetails ("string_key" , new Value ("CC0000" ), new MutableContext ());
773
782
FlagEvaluationDetails <Value > want = FlagEvaluationDetails .<Value >builder ()
774
783
.value (new Value ("CC0000" ))
784
+ .flagKey ("string_key" )
775
785
.errorCode (ErrorCode .TARGETING_KEY_MISSING )
776
786
.reason (Reason .ERROR .name ())
777
787
.build ();
0 commit comments