You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://www.repostatus.org/#wip)
Copy file name to clipboardExpand all lines: src/test/java/dev/openfeature/sdk/ProviderSpecTest.java
+12-12
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,20 @@
8
8
publicclassProviderSpecTest {
9
9
NoOpProviderp = newNoOpProvider();
10
10
11
-
@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.")
11
+
@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.")
12
12
@Testvoidname_accessor() {
13
13
assertNotNull(p.getName());
14
14
}
15
15
16
-
@Specification(number="2.3.1", text="The feature provider interface MUST define methods for typed " +
16
+
@Specification(number="2.2.2.1", text="The feature provider interface MUST define methods for typed " +
17
17
"flag resolution, including boolean, numeric, string, and structure.")
18
-
@Specification(number="2.4", text="In cases of normal execution, the provider MUST populate the " +
18
+
@Specification(number="2.2.3", text="In cases of normal execution, the provider MUST populate the " +
19
19
"flag resolution structure's value field with the resolved flag value.")
20
-
@Specification(number="2.2", text="The feature provider interface MUST define methods to resolve " +
20
+
@Specification(number="2.2.1", text="The feature provider interface MUST define methods to resolve " +
21
21
"flag values, with parameters flag key (string, required), default value " +
22
22
"(boolean | number | string | structure, required) and evaluation context (optional), " +
23
23
"which returns a flag resolution structure.")
24
-
@Specification(number="2.9.1", text="The flag resolution structure SHOULD accept a generic " +
24
+
@Specification(number="2.2.8.1", text="The flag resolution structure SHOULD accept a generic " +
25
25
"argument (or use an equivalent language feature) which indicates the type of the wrapped value field.")
@@ -41,25 +41,25 @@ public class ProviderSpecTest {
41
41
42
42
}
43
43
44
-
@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.")
44
+
@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.")
45
45
@Testvoidhas_reason() {
46
46
ProviderEvaluation<Boolean> result = p.getBooleanEvaluation("key", false, newMutableContext());
@Specification(number="2.7", text="In cases of normal execution, the provider MUST NOT populate " +
50
+
@Specification(number="2.2.6", text="In cases of normal execution, the provider MUST NOT populate " +
51
51
"the flag resolution structure's error code field, or otherwise must populate it with a null or falsy value.")
52
52
@Testvoidno_error_code_by_default() {
53
53
ProviderEvaluation<Boolean> result = p.getBooleanEvaluation("key", false, newMutableContext());
54
54
assertNull(result.getErrorCode());
55
55
}
56
56
57
-
@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`.")
58
-
@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.")
59
-
@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.")
57
+
@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`.")
58
+
@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.")
59
+
@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.")
60
60
@Testvoidup_to_provider_implementation() {}
61
61
62
-
@Specification(number="2.5", text="In cases of normal execution, the provider SHOULD populate the " +
62
+
@Specification(number="2.2.4", text="In cases of normal execution, the provider SHOULD populate the " +
63
63
"flag resolution structure's variant field with a string identifier corresponding to the returned flag value.")
@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.")
78
+
@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.")
79
79
@Specification(number="4.4.1", text="The API, Client, Provider, and invocation MUST have a method for registering hooks.")
0 commit comments