Skip to content

Commit 5d56086

Browse files
committed
feat: improve contextEnrichment to handle special cases.
relates: open-feature/java-sdk-contrib#1230 Signed-off-by: Simon Schrottner <[email protected]>
1 parent 34a0c31 commit 5d56086

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

gherkin/contextEnrichment.feature

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@contextEnrichment
2+
Feature: Context Enrichment
3+
4+
Background:
5+
Given an option "cache" of type "CacheType" with value "disabled"
6+
And a stable flagd provider
7+
8+
@contextEnrichment @in-process @rpc
9+
Scenario: Use enriched context
10+
Given a String-flag with key "flagd-context-aware" and a default value "not"
11+
When the flag was evaluated with details
12+
Then the resolved details value should be "INTERNAL"
13+
14+
@contextEnrichment @grace @in-process
15+
Scenario: Use enriched context on connection error for IN-PROCESS
16+
Given a String-flag with key "flagd-context-aware" and a default value "not"
17+
And a stale event handler
18+
When the flag was evaluated with details
19+
Then the resolved details value should be "INTERNAL"
20+
When the connection is lost for 6s
21+
And a stale event was fired
22+
When the flag was evaluated with details
23+
Then the resolved details value should be "INTERNAL"
24+
25+
@contextEnrichment @grace @rpc
26+
Scenario: Use enriched context on connection error for RPC
27+
Given a String-flag with key "flagd-context-aware" and a default value "not"
28+
And a stale event handler
29+
When the flag was evaluated with details
30+
Then the resolved details value should be "INTERNAL"
31+
When the connection is lost for 6s
32+
And a stale event was fired
33+
When the flag was evaluated with details
34+
Then the resolved details value should be "not"
35+

0 commit comments

Comments
 (0)