Merge pull request #63 from open-feature/fix/consistent-ctx-setter

!feat: Make evaluation accessors setters consistent
This commit is contained in:
Justin Abrahms 2022-09-08 09:40:31 -07:00 committed by GitHub
commit 35c9c7e06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class OpenFeatureAPI {
private FeatureProvider provider;
@Getter
@Setter
private EvaluationContext ctx;
private EvaluationContext evaluationContext;
@Getter
private List<Hook> apiHooks;

View File

@ -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

View File

@ -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();