From c5ca187d660fa0a01065693eed25de6d9757dcfd Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 17 Oct 2022 15:16:09 -0400 Subject: [PATCH 1/2] chore: update test/spec association numbers Signed-off-by: Todd Baert --- .../dev/openfeature/sdk/ProviderSpecTest.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/java/dev/openfeature/sdk/ProviderSpecTest.java b/src/test/java/dev/openfeature/sdk/ProviderSpecTest.java index 27cc64e8f..23d8bc2b2 100644 --- a/src/test/java/dev/openfeature/sdk/ProviderSpecTest.java +++ b/src/test/java/dev/openfeature/sdk/ProviderSpecTest.java @@ -8,20 +8,20 @@ public class ProviderSpecTest { NoOpProvider p = new NoOpProvider(); - @Specification(number="2.1", text="The provider interface MUST define a metadata member or accessor, containing a name field or accessor of type string, which identifies the provider implementation.") + @Specification(number="2.1.1", text="The provider interface MUST define a metadata member or accessor, containing a name field or accessor of type string, which identifies the provider implementation.") @Test void name_accessor() { assertNotNull(p.getName()); } - @Specification(number="2.3.1", text="The feature provider interface MUST define methods for typed " + + @Specification(number="2.2.2.1", text="The feature provider interface MUST define methods for typed " + "flag resolution, including boolean, numeric, string, and structure.") - @Specification(number="2.4", text="In cases of normal execution, the provider MUST populate the " + + @Specification(number="2.2.3", text="In cases of normal execution, the provider MUST populate the " + "flag resolution structure's value field with the resolved flag value.") - @Specification(number="2.2", text="The feature provider interface MUST define methods to resolve " + + @Specification(number="2.2.1", text="The feature provider interface MUST define methods to resolve " + "flag values, with parameters flag key (string, required), default value " + "(boolean | number | string | structure, required) and evaluation context (optional), " + "which returns a flag resolution structure.") - @Specification(number="2.9.1", text="The flag resolution structure SHOULD accept a generic " + + @Specification(number="2.2.8.1", text="The flag resolution structure SHOULD accept a generic " + "argument (or use an equivalent language feature) which indicates the type of the wrapped value field.") @Test void flag_value_set() { ProviderEvaluation int_result = p.getIntegerEvaluation("key", 4, new MutableContext()); @@ -41,25 +41,25 @@ public class ProviderSpecTest { } - @Specification(number="2.6", text="The `provider` SHOULD populate the `flag resolution` structure's `reason` field with `\"DEFAULT\",` `\"TARGETING_MATCH\"`, `\"SPLIT\"`, `\"DISABLED\"`, `\"UNKNOWN\"`, `\"ERROR\"` or some other string indicating the semantic reason for the returned flag value.") + @Specification(number="2.2.5", text="The `provider` SHOULD populate the `flag resolution` structure's `reason` field with `\"DEFAULT\",` `\"TARGETING_MATCH\"`, `\"SPLIT\"`, `\"DISABLED\"`, `\"UNKNOWN\"`, `\"ERROR\"` or some other string indicating the semantic reason for the returned flag value.") @Test void has_reason() { ProviderEvaluation result = p.getBooleanEvaluation("key", false, new MutableContext()); assertEquals(Reason.DEFAULT.toString(), result.getReason()); } - @Specification(number="2.7", text="In cases of normal execution, the provider MUST NOT populate " + + @Specification(number="2.2.6", text="In cases of normal execution, the provider MUST NOT populate " + "the flag resolution structure's error code field, or otherwise must populate it with a null or falsy value.") @Test void no_error_code_by_default() { ProviderEvaluation result = p.getBooleanEvaluation("key", false, new MutableContext()); assertNull(result.getErrorCode()); } - @Specification(number="2.8", text="In cases of abnormal execution, the `provider` **MUST** indicate an error using the idioms of the implementation language, with an associated `error code` and optional associated `error message`.") - @Specification(number="2.11", text="In cases of normal execution, the `provider` **MUST NOT** populate the `flag resolution` structure's `error message` field, or otherwise must populate it with a null or falsy value.") - @Specification(number="2.12", text="In cases of abnormal execution, the `evaluation details` structure's `error message` field **MAY** contain a string containing additional detail about the nature of the error.") + @Specification(number="2.2.7", text="In cases of abnormal execution, the `provider` **MUST** indicate an error using the idioms of the implementation language, with an associated `error code` and optional associated `error message`.") + @Specification(number="2.3.2", text="In cases of normal execution, the `provider` **MUST NOT** populate the `flag resolution` structure's `error message` field, or otherwise must populate it with a null or falsy value.") + @Specification(number="2.3.3", text="In cases of abnormal execution, the `evaluation details` structure's `error message` field **MAY** contain a string containing additional detail about the nature of the error.") @Test void up_to_provider_implementation() {} - @Specification(number="2.5", text="In cases of normal execution, the provider SHOULD populate the " + + @Specification(number="2.2.4", text="In cases of normal execution, the provider SHOULD populate the " + "flag resolution structure's variant field with a string identifier corresponding to the returned flag value.") @Test void variant_set() { ProviderEvaluation int_result = p.getIntegerEvaluation("key", 4, new MutableContext()); @@ -75,7 +75,7 @@ public class ProviderSpecTest { assertNotNull(boolean_result.getReason()); } - @Specification(number="2.10", text="The provider interface MUST define a provider hook mechanism which can be optionally implemented in order to add hook instances to the evaluation life-cycle.") + @Specification(number="2.3.1", text="The provider interface MUST define a provider hook mechanism which can be optionally implemented in order to add hook instances to the evaluation life-cycle.") @Specification(number="4.4.1", text="The API, Client, Provider, and invocation MUST have a method for registering hooks.") @Test void provider_hooks() { assertEquals(0, p.getProviderHooks().size()); From b44bb1439c3aff831726014699c3ccfb993ee3fd Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 17 Oct 2022 15:19:54 -0400 Subject: [PATCH 2/2] chore: update spec tag Signed-off-by: Todd Baert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b786c7ce..3a8c93774 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.openfeature/sdk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.openfeature/sdk) [![javadoc](https://javadoc.io/badge2/dev.openfeature/sdk/javadoc.svg)](https://javadoc.io/doc/dev.openfeature/sdk) [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) -[![Specification](https://img.shields.io/static/v1?label=Specification&message=v0.5.0&color=yellow)](https://github.com/open-feature/spec/tree/v0.5.0) +[![v0.5.1](https://img.shields.io/static/v1?label=Specification&message=v0.5.1&color=yellow)](https://github.com/open-feature/spec/tree/v0.5.1) [![Known Vulnerabilities](https://snyk.io/test/github/open-feature/java-sdk/badge.svg)](https://snyk.io/test/github/open-feature/java-sdk) [![on-merge](https://github.com/open-feature/java-sdk/actions/workflows/merge.yml/badge.svg)](https://github.com/open-feature/java-sdk/actions/workflows/merge.yml) [![codecov](https://codecov.io/gh/open-feature/java-sdk/branch/main/graph/badge.svg?token=XMS9L7PBY1)](https://codecov.io/gh/open-feature/java-sdk)