Skip to content

Commit 7fa39bc

Browse files
committed
Keep tests in line with spec changes
1 parent 5022538 commit 7fa39bc

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

spec_finder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def _demarkdown(t):
1212
def get_spec(force_refresh=False):
1313
spec_path = './specification.json'
1414
data = ""
15-
if os.path.exists(spec_path):
15+
if os.path.exists(spec_path) and not force_refresh:
1616
with open(spec_path) as f:
1717
data = ''.join(f.readlines())
1818
else:

src/test/java/dev/openfeature/javasdk/FlagEvaluationSpecTest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private Client _client() {
225225
}
226226

227227
@Specification(number="3.2.1", text="The API, Client and invocation MUST have a method for supplying evaluation context.")
228-
@Specification(number="3.2.2", text="Evaluation context MUST be merged in the order: API (global) - client - invocation, with duplicate values being overwritten.")
228+
@Specification(number="3.2.2", text="Evaluation context MUST be merged in the order: API (global; lowest precedence) - client - invocation - before hooks (highest precedence), with duplicate values being overwritten.")
229229
@Test void multi_layer_context_merges_correctly() {
230230
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
231231
DoSomethingProvider provider = new DoSomethingProvider();
@@ -266,9 +266,6 @@ private Client _client() {
266266
@Specification(number="1.1.6", text="The client creation function MUST NOT throw, or otherwise abnormally terminate.")
267267
@Test void constructor_does_not_throw() {}
268268

269-
@Specification(number="1.6.1", text="The client SHOULD transform the evaluation context using the provider's context transformer function if one is defined, before passing the result of the transformation to the provider's flag resolution functions.")
270-
@Test void not_doing_unless_someone_has_a_good_reason_why() {}
271-
272269
@Specification(number="1.4.11", text="The client SHOULD provide asynchronous or non-blocking mechanisms for flag evaluation.")
273270
@Test void one_thread_per_request_model() {}
274271
}

src/test/java/dev/openfeature/javasdk/HookSpecTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public void finallyAfter(HookContext<Boolean> ctx, Map<String, Object> hints) {
470470

471471
}
472472

473-
@Specification(number="4.3.4", text="When before hooks have finished executing, any resulting evaluation context MUST be merged with the existing evaluation context in the following order: before-hook (highest precedence), invocation, client, api (lowest precedence).")
473+
@Specification(number="4.3.4", text="When before hooks have finished executing, any resulting evaluation context MUST be merged with the existing evaluation context.")
474474
@Test void mergeHappensCorrectly() {
475475
EvaluationContext hookCtx = new EvaluationContext();
476476
hookCtx.add("test", "works");

src/test/java/dev/openfeature/javasdk/ProviderSpecTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public class ProviderSpecTest {
1919
"flag resolution structure's value field with the resolved flag value.")
2020
@Specification(number="2.2", text="The feature provider interface MUST define methods to resolve " +
2121
"flag values, with parameters flag key (string, required), default value " +
22-
"(boolean | number | string | structure, required), evaluation context (optional), and " +
23-
"evaluation options (optional), which returns a flag resolution structure.")
22+
"(boolean | number | string | structure, required) and evaluation context (optional), " +
23+
"which returns a flag resolution structure.")
2424
@Specification(number="2.9.1", text="The flag resolution structure SHOULD accept a generic " +
2525
"argument (or use an equivalent language feature) which indicates the type of the wrapped value field.")
2626
@Test void flag_value_set() {

0 commit comments

Comments
 (0)