@@ -236,6 +236,7 @@ void should_throw_an_error_if_endpoint_not_available() {
236236 FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("fail_500" , false , this .evaluationContext );
237237 FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
238238 .value (false )
239+ .flagKey ("fail_500" )
239240 .reason (Reason .ERROR .name ())
240241 .errorCode (ErrorCode .GENERAL )
241242 .errorMessage ("unknown error while retrieving flag fail_500" )
@@ -257,6 +258,7 @@ void should_throw_an_error_if_invalid_api_key() {
257258 FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("fail_401" , false , this .evaluationContext );
258259 FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
259260 .value (false )
261+ .flagKey ("fail_401" )
260262 .reason (Reason .ERROR .name ())
261263 .errorCode (ErrorCode .GENERAL )
262264 .errorMessage ("authentication/authorization error" )
@@ -277,6 +279,7 @@ void should_throw_an_error_if_flag_does_not_exists() {
277279 FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("flag_not_found" , false , this .evaluationContext );
278280 FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
279281 .value (false )
282+ .flagKey ("flag_not_found" )
280283 .reason (Reason .ERROR .name ())
281284 .errorCode (ErrorCode .FLAG_NOT_FOUND )
282285 .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() {
297300 FlagEvaluationDetails <Boolean > got = client .getBooleanDetails ("string_key" , false , this .evaluationContext );
298301 FlagEvaluationDetails <Boolean > want = FlagEvaluationDetails .<Boolean >builder ()
299302 .value (false )
303+ .flagKey ("string_key" )
300304 .reason (Reason .ERROR .name ())
301305 .errorCode (ErrorCode .TYPE_MISMATCH )
302306 .errorMessage (
@@ -515,6 +519,7 @@ void should_throw_an_error_if_we_expect_a_string_and_got_another_type() {
515519 client .getStringDetails ("bool_targeting_match" , "defaultValue" , this .evaluationContext );
516520 FlagEvaluationDetails <String > want = FlagEvaluationDetails .<String >builder ()
517521 .value ("defaultValue" )
522+ .flagKey ("bool_targeting_match" )
518523 .reason (Reason .ERROR .name ())
519524 .errorMessage (
520525 "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() {
579584 client .getIntegerDetails ("bool_targeting_match" , 200 , this .evaluationContext );
580585 FlagEvaluationDetails <Integer > want = FlagEvaluationDetails .<Integer >builder ()
581586 .value (200 )
587+ .flagKey ("bool_targeting_match" )
582588 .reason (Reason .ERROR .name ())
583589 .errorMessage (
584590 "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() {
641647 FlagEvaluationDetails <Integer > got = client .getIntegerDetails ("double_key" , 200 , this .evaluationContext );
642648 FlagEvaluationDetails <Integer > want = FlagEvaluationDetails .<Integer >builder ()
643649 .value (200 )
650+ .flagKey ("double_key" )
644651 .reason (Reason .ERROR .name ())
645652 .errorMessage (
646653 "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() {
727734 .value (new Value (new MutableStructure ()
728735 .add ("test" , "test1" )
729736 .add ("test2" , false )
737+ .add ("test5" , new Value ())
730738 .add ("test3" , 123.3 )
731739 .add ("test4" , 1 )))
740+ .flagKey ("object_key" )
732741 .reason (Reason .TARGETING_MATCH .name ())
733742 .variant ("True" )
734743 .flagMetadata (defaultMetadata )
@@ -772,6 +781,7 @@ void should_throw_an_error_if_no_targeting_key() {
772781 client .getObjectDetails ("string_key" , new Value ("CC0000" ), new MutableContext ());
773782 FlagEvaluationDetails <Value > want = FlagEvaluationDetails .<Value >builder ()
774783 .value (new Value ("CC0000" ))
784+ .flagKey ("string_key" )
775785 .errorCode (ErrorCode .TARGETING_KEY_MISSING )
776786 .reason (Reason .ERROR .name ())
777787 .build ();
0 commit comments