backendPorts() {
+ return Collections.singletonList(OFREP_PORT);
+ }
+
+ @Override
+ public FeatureProvider createProvider(BackendEndpoint endpoint) {
+ return OfrepProvider.constructProvider(OfrepProviderOptions.builder()
+ .baseUrl("http://" + endpoint.host() + ":" + endpoint.port(OFREP_PORT))
+ .build());
+ }
+
+ @Override
+ public FeatureProvider createUnavailableProvider() {
+ return OfrepProvider.constructProvider(OfrepProviderOptions.builder()
+ .baseUrl("http://localhost:" + UNAVAILABLE_PORT)
+ .connectTimeout(Duration.ofMillis(500))
+ .requestTimeout(Duration.ofMillis(500))
+ .build());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * The provider has no lifecycle of its own: no {@code initialize()}, no events, no state
+ * between calls, and an executor {@code shutdown()} never recreates. That withholds lifecycle,
+ * reinitialization, events, stale, configuration change and unavailable init. Numeric coercion
+ * is withheld because the provider keeps integers and doubles strictly apart, which the rule
+ * allows. Disabled flags is a defect; see {@link #knownDeviations()}.
+ */
+ @Override
+ public Set capabilities() {
+ return Capability.declarableExcept(
+ Capability.LIFECYCLE,
+ Capability.REINITIALIZATION,
+ Capability.EVENTS,
+ Capability.STALE,
+ Capability.CONFIGURATION_CHANGE,
+ Capability.DISABLED_FLAGS,
+ Capability.UNAVAILABLE_INIT,
+ Capability.NUMERIC_COERCION);
+ }
+
+ @Override
+ public List knownDeviations() {
+ return Collections.singletonList(KnownDeviation.untracked(
+ Capability.DISABLED_FLAGS,
+ "A value-less OFREP evaluation success (codeDefaultFlag) is reported as FLAG_NOT_FOUND "
+ + "instead of the code default with the server's reason; flagd answers a "
+ + "disabled flag that way."));
+ }
+}