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
Copy file name to clipboardExpand all lines: src/test/java/dev/openfeature/javasdk/FlagEvaluationSpecTest.java
+7-5
Original file line number
Diff line number
Diff line change
@@ -183,14 +183,16 @@ private Client _client() {
183
183
}
184
184
185
185
@Specification(number="1.4.9", text="Methods, functions, or operations on the client MUST NOT throw exceptions, or otherwise abnormally terminate. Flag evaluation calls must always return the default value in the event of abnormal execution. Exceptions include functions or methods for the purposes for configuration or setup.")
186
-
@Specification(number="1.4.7", text="In cases of abnormal execution, the evaluation details structure's error code field MUST contain a string identifying an error occurred during flag evaluation and the nature of the error.")
186
+
@Specification(number="1.4.7", text="In cases of abnormal execution, the `evaluation details` structure's `error code` field **MUST** contain an `error code`.")
187
+
@Specification(number="1.4.12", text="In cases of abnormal execution, the `evaluation details` structure's `error message` field **MAY** contain a string containing additional details about the nature of the error.")
@Specification(number="1.4.10", text="In the case of abnormal execution, the client SHOULD log an informative error message.")
@@ -200,8 +202,8 @@ private Client _client() {
200
202
api.setProvider(newAlwaysBrokenProvider());
201
203
Clientc = api.getClient();
202
204
FlagEvaluationDetails<Boolean> result = c.getBooleanDetails("test", false);
203
-
assertEquals(Reason.ERROR, result.getReason());
204
-
assertThat(TEST_LOGGER.getLoggingEvents()).contains(LoggingEvent.error("Unable to correctly evaluate flag with key {} due to exception {}", "test", "BORK"));
assertThat(TEST_LOGGER.getLoggingEvents()).contains(LoggingEvent.error("Unable to correctly evaluate flag with key {} due to exception {}", "test", TestConstants.BROKEN_MESSAGE));
205
207
}
206
208
207
209
@Specification(number="1.2.2", text="The client interface MUST define a metadata member or accessor, containing an immutable name field or accessor of type string, which corresponds to the name value supplied during client creation.")
@@ -221,7 +223,7 @@ private Client _client() {
221
223
api.setProvider(newAlwaysBrokenProvider());
222
224
Clientc = api.getClient();
223
225
FlagEvaluationDetails<Boolean> result = c.getBooleanDetails("test", false);
@Specification(number="2.7", text="In cases of normal execution, the provider MUST NOT populate " +
@@ -55,9 +55,9 @@ public class ProviderSpecTest {
55
55
assertNull(result.getErrorCode());
56
56
}
57
57
58
-
@Specification(number="2.8", text="In cases of abnormal execution, the providerMUST indicate an " +
59
-
"error using the idioms of the implementation language, with an associated error code having possible " +
60
-
"values PROVIDER_NOT_READY, FLAG_NOT_FOUND, PARSE_ERROR, TYPE_MISMATCH, or GENERAL.")
58
+
@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`.")
59
+
@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.")
60
+
@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.")
61
61
@Testvoidup_to_provider_implementation() {}
62
62
63
63
@Specification(number="2.5", text="In cases of normal execution, the provider SHOULD populate the " +
0 commit comments