@@ -38,8 +38,18 @@ Client _client() {
38
38
@ Specification (spec ="flag evaluation" , number ="1.3" , text ="The API MUST provide a function to add hooks which " +
39
39
"accepts one or more API-conformant hooks, and appends them to the collection of any previously added hooks." +
40
40
"When new hooks are added, previously added hooks are not removed." )
41
- @ Disabled @ Test void hook_addition () {
42
- throw new NotImplementedException ();
41
+ @ Test void hook_addition () {
42
+ Hook h1 = mock (Hook .class );
43
+ Hook h2 = mock (Hook .class );
44
+ OpenFeatureAPI api = OpenFeatureAPI .getInstance ();
45
+ api .registerHooks (h1 );
46
+
47
+ assertEquals (1 , api .getApiHooks ().size ());
48
+ assertEquals (h1 , api .getApiHooks ().get (0 ));
49
+
50
+ api .registerHooks (h2 );
51
+ assertEquals (2 , api .getApiHooks ().size ());
52
+ assertEquals (h2 , api .getApiHooks ().get (1 ));
43
53
}
44
54
45
55
@ Specification (spec ="flag evaluation" , number ="1.5" , text ="The API MUST provide a function for creating a client " +
@@ -160,7 +170,7 @@ Client _client() {
160
170
@ Specification (spec ="flag evaluation" , number ="1.21" , text ="The client MUST transform the evaluation context using " +
161
171
"the provider's context transformer function, before passing the result of the transformation to the " +
162
172
"provider's flag resolution functions." )
163
- void todo () {}
173
+ @ Test @ Disabled void todo () {}
164
174
165
175
@ Specification (spec ="flag evaluation" , number ="1.20" , text ="The client SHOULD provide asynchronous or non-blocking " +
166
176
"mechanisms for flag evaluation." )
0 commit comments