Skip to content

Commit

Permalink
chore: update test/spec association numbers, badge (#156)
Browse files Browse the repository at this point in the history
* chore: update test/spec association numbers

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* chore: update spec tag

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
  • Loading branch information
toddbaert authored Oct 17, 2022
1 parent 2766161 commit 6a299d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions src/test/java/dev/openfeature/sdk/ProviderSpecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer> int_result = p.getIntegerEvaluation("key", 4, new MutableContext());
Expand All @@ -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<Boolean> 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<Boolean> 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<Integer> int_result = p.getIntegerEvaluation("key", 4, new MutableContext());
Expand All @@ -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());
Expand Down

0 comments on commit 6a299d7

Please sign in to comment.