99
1010import dev .openfeature .sdk .fixtures .HookFixtures ;
1111import java .util .Arrays ;
12+ import java .util .Collections ;
1213import java .util .HashMap ;
1314import java .util .List ;
1415import java .util .Map ;
@@ -38,7 +39,13 @@ void shouldMergeEvaluationContextsOnBeforeHooksCorrectly() {
3839 var sharedContext = getBaseHookContextForType (FlagValueType .STRING );
3940 var hookSupportData = new HookSupportData ();
4041 hookSupportData .evaluationContext = layered ;
41- hookSupport .setHooks (hookSupportData , Arrays .asList (hook1 , hook2 ), FlagValueType .STRING );
42+ hookSupport .setHooks (
43+ hookSupportData ,
44+ Collections .emptyList (),
45+ Collections .emptyList (),
46+ Arrays .asList (hook1 , hook2 ),
47+ Collections .emptyList (),
48+ FlagValueType .STRING );
4249 hookSupport .setHookContexts (hookSupportData , sharedContext , layered );
4350
4451 hookSupport .executeBeforeHooks (hookSupportData );
@@ -57,7 +64,13 @@ void shouldAlwaysCallGenericHook(FlagValueType flagValueType) {
5764 Hook <?> genericHook = mockGenericHook ();
5865
5966 var hookSupportData = new HookSupportData ();
60- hookSupport .setHooks (hookSupportData , List .of (genericHook ), flagValueType );
67+ hookSupport .setHooks (
68+ hookSupportData ,
69+ Collections .emptyList (),
70+ Collections .emptyList (),
71+ List .of (genericHook ),
72+ Collections .emptyList (),
73+ flagValueType );
6174
6275 callAllHooks (hookSupportData );
6376
@@ -73,7 +86,13 @@ void shouldAlwaysCallGenericHook(FlagValueType flagValueType) {
7386 void shouldPassDataAcrossStages (FlagValueType flagValueType ) {
7487 var testHook = new TestHookWithData ();
7588 var hookSupportData = new HookSupportData ();
76- hookSupport .setHooks (hookSupportData , List .of (testHook ), flagValueType );
89+ hookSupport .setHooks (
90+ hookSupportData ,
91+ Collections .emptyList (),
92+ Collections .emptyList (),
93+ List .of (testHook ),
94+ Collections .emptyList (),
95+ flagValueType );
7796 hookSupport .setHookContexts (
7897 hookSupportData ,
7998 getBaseHookContextForType (flagValueType ),
@@ -102,7 +121,13 @@ void shouldIsolateDataBetweenHooks(FlagValueType flagValueType) {
102121 var testHook2 = new TestHookWithData (2 );
103122
104123 var hookSupportData = new HookSupportData ();
105- hookSupport .setHooks (hookSupportData , List .of (testHook1 , testHook2 ), flagValueType );
124+ hookSupport .setHooks (
125+ hookSupportData ,
126+ Collections .emptyList (),
127+ Collections .emptyList (),
128+ List .of (testHook1 , testHook2 ),
129+ Collections .emptyList (),
130+ flagValueType );
106131 hookSupport .setHookContexts (
107132 hookSupportData ,
108133 getBaseHookContextForType (flagValueType ),
@@ -132,7 +157,13 @@ public Optional<EvaluationContext> before(HookContext ctx, Map hints) {
132157 var layeredEvaluationContext =
133158 new LayeredEvaluationContext (evaluationContextWithValue ("key" , "value" ), null , null , null );
134159 hookSupportData .evaluationContext = layeredEvaluationContext ;
135- hookSupport .setHooks (hookSupportData , List .of (recursiveHook , emptyHook ), FlagValueType .STRING );
160+ hookSupport .setHooks (
161+ hookSupportData ,
162+ Collections .emptyList (),
163+ Collections .emptyList (),
164+ List .of (recursiveHook , emptyHook ),
165+ Collections .emptyList (),
166+ FlagValueType .STRING );
136167 hookSupport .setHookContexts (
137168 hookSupportData , getBaseHookContextForType (FlagValueType .STRING ), layeredEvaluationContext );
138169
0 commit comments