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
Update the test annotations with new spec verbiage, and update the spec compliance badge.
The functional changes have already been merged/released.
Signed-off-by: Todd Baert <[email protected]>
[](https://www.repostatus.org/#active)
@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
-
@Testvoidname_accessor() {
12
+
@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.")
13
+
@Test
14
+
voidname_accessor() {
13
15
assertNotNull(p.getName());
14
16
}
15
17
16
-
@Specification(number="2.2.2.1", text="The feature provider interface MUST define methods for typed " +
18
+
@Specification(number = "2.2.2.1", text = "The feature provider interface MUST define methods for typed " +
17
19
"flag resolution, including boolean, numeric, string, and structure.")
18
-
@Specification(number="2.2.3", text="In cases of normal execution, the provider MUST populate the " +
19
-
"flag resolution structure's value field with the resolved flag value.")
20
-
@Specification(number="2.2.1", text="The feature provider interface MUST define methods to resolve " +
21
-
"flag values, with parameters flag key (string, required), default value " +
22
-
"(boolean | number | string | structure, required) and evaluation context (optional), " +
23
-
"which returns a flag resolution structure.")
24
-
@Specification(number="2.2.8.1", text="The flag resolution structure SHOULD accept a generic " +
25
-
"argument (or use an equivalent language feature) which indicates the type of the wrapped value field.")
26
-
@Testvoidflag_value_set() {
20
+
@Specification(number = "2.2.3", text = "In cases of normal execution, the `provider` MUST populate the `resolution details` structure's `value` field with the resolved flag value.")
21
+
@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 `resolution details` structure.")
22
+
@Specification(number = "2.2.8.1", text = "The `resolution details` structure SHOULD accept a generic argument (or use an equivalent language feature) which indicates the type of the wrapped `value` field.")
@@ -41,27 +39,30 @@ public class ProviderSpecTest {
41
39
42
40
}
43
41
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
-
@Testvoidhas_reason() {
42
+
@Specification(number = "2.2.5", text = "The `provider` SHOULD populate the `resolution details` structure's `reason` field with `\"STATIC\"`, `\"DEFAULT\",` `\"TARGETING_MATCH\"`, `\"SPLIT\"`, `\"CACHED\"`, `\"DISABLED\"`, `\"UNKNOWN\"`, `\"ERROR\"` or some other string indicating the semantic reason for the returned flag value.")
43
+
@Test
44
+
voidhas_reason() {
46
45
ProviderEvaluation<Boolean> result = p.getBooleanEvaluation("key", false, newMutableContext());
@Specification(number="2.2.6", text="In cases of normal execution, the provider MUST NOT populate " +
51
-
"the flag resolution structure's error code field, or otherwise must populate it with a null or falsy value.")
52
-
@Testvoidno_error_code_by_default() {
49
+
@Specification(number = "2.2.6", text = "In cases of normal execution, the `provider` MUST NOT populate the `resolution details` structure's `error code` field, or otherwise must populate it with a null or falsy value.")
50
+
@Test
51
+
voidno_error_code_by_default() {
53
52
ProviderEvaluation<Boolean> result = p.getBooleanEvaluation("key", false, newMutableContext());
54
53
assertNull(result.getErrorCode());
55
54
}
56
55
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
-
@Testvoidup_to_provider_implementation() {}
56
+
@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`.")
57
+
@Specification(number = "2.3.2", text = "In cases of normal execution, the `provider` MUST NOT populate the `resolution details` structure's `error message` field, or otherwise must populate it with a null or falsy value.")
58
+
@Specification(number = "2.3.3", text = "In cases of abnormal execution, the `resolution details` structure's `error message` field MAY contain a string containing additional detail about the nature of the error.")
59
+
@Test
60
+
voidup_to_provider_implementation() {
61
+
}
61
62
62
-
@Specification(number="2.2.4", text="In cases of normal execution, the provider SHOULD populate the " +
63
-
"flag resolution structure's variant field with a string identifier corresponding to the returned flag value.")
64
-
@Testvoidvariant_set() {
63
+
@Specification(number = "2.2.4", text = "In cases of normal execution, the `provider` SHOULD populate the `resolution details` structure's `variant` field with a string identifier corresponding to the returned flag value.")
@@ -75,9 +76,10 @@ public class ProviderSpecTest {
75
76
assertNotNull(boolean_result.getReason());
76
77
}
77
78
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
-
@Specification(number="4.4.1", text="The API, Client, Provider, and invocation MUST have a method for registering hooks.")
80
-
@Testvoidprovider_hooks() {
79
+
@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.")
80
+
@Specification(number = "4.4.1", text = "The API, Client, Provider, and invocation MUST have a method for registering hooks.")
0 commit comments