Merge pull request #63 from open-feature/fix/consistent-ctx-setter
!feat: Make evaluation accessors setters consistent
This commit is contained in:
commit
35c9c7e06f
|
|
@ -19,7 +19,7 @@ public class OpenFeatureAPI {
|
|||
private FeatureProvider provider;
|
||||
@Getter
|
||||
@Setter
|
||||
private EvaluationContext ctx;
|
||||
private EvaluationContext evaluationContext;
|
||||
@Getter
|
||||
private List<Hook> apiHooks;
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class OpenFeatureClient implements Client {
|
|||
// merge of: API.context, client.context, invocation.context
|
||||
EvaluationContext mergedCtx = EvaluationContext.merge(
|
||||
EvaluationContext.merge(
|
||||
openfeatureApi.getCtx(),
|
||||
openfeatureApi.getEvaluationContext(),
|
||||
this.getEvaluationContext()
|
||||
),
|
||||
invocationCtx
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class FlagEvaluationSpecTest implements HookFixtures {
|
|||
|
||||
@AfterEach void reset_ctx() {
|
||||
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
|
||||
api.setCtx(null);
|
||||
api.setEvaluationContext(null);
|
||||
}
|
||||
|
||||
@Specification(number="1.1.1", text="The API, and any state it maintains SHOULD exist as a global singleton, even in cases wherein multiple versions of the API are present at runtime.")
|
||||
|
|
@ -235,7 +235,7 @@ class FlagEvaluationSpecTest implements HookFixtures {
|
|||
apiCtx.add("common", "1");
|
||||
apiCtx.add("common2", "1");
|
||||
apiCtx.add("api", "2");
|
||||
api.setCtx(apiCtx);
|
||||
api.setEvaluationContext(apiCtx);
|
||||
|
||||
Client c = api.getClient();
|
||||
EvaluationContext clientCtx = new EvaluationContext();
|
||||
|
|
|
|||
Loading…
Reference in New Issue