Class BrowserlessFeatureFlags
-
- All Implemented Interfaces:
-
java.io.Serializable
public class BrowserlessFeatureFlags extends FeatureFlagsFeatureFlags implementation that applies test defined feature flag overrides on top of the ones resolved by Vaadin.
The instance is installed into the VaadinContext of the mock environment before the Vaadin servlet is initialized, so that everything reading feature flags during startup, for example a com.vaadin.flow.server.VaadinServiceInitListener, already observes the test configuration.
For internal use only. May be renamed or removed in a future release.
- Since:
25.3
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringPROPERTIES_FILENAMEpublic final static StringSYSTEM_PROPERTY_PREFIX_EXPERIMENTALpublic final static FeatureCOLLABORATION_ENGINE_BACKENDpublic final static FeatureACCESSIBLE_DISABLED_BUTTONSpublic final static FeatureCOMPONENT_STYLE_INJECTIONpublic final static FeatureHILLA_FULLSTACK_SIGNALSpublic final static FeatureLAYOUT_COMPONENT_IMPROVEMENTSpublic final static FeatureDEFAULT_AUTO_RESPONSIVE_FORM_LAYOUTpublic List<Feature>features
-
Method Summary
Modifier and Type Method Description static voidinstall(VaadinContext context, Map<String, Boolean> overrides)Installs a FeatureFlags instance applying the given overrides into the given Vaadin context. voidloadProperties()Re-applies the test defined overrides, so that they are not silently discarded by code reloading the feature flags, for example through setPropertiesLocation. voidsetEnabled(String featureId, boolean enabled)Toggles the feature for the current test only. -
-
Method Detail
-
install
static void install(VaadinContext context, Map<String, Boolean> overrides)
Installs a FeatureFlags instance applying the given overrides into the given Vaadin context.
Must be invoked before anything requests the feature flags for the context, otherwise Vaadin creates and caches its own instance.
- Parameters:
context- the Vaadin context of the mock environment, not nulloverrides- feature identifiers mapped to their enablement state, not null
-
loadProperties
void loadProperties()
Re-applies the test defined overrides, so that they are not silently discarded by code reloading the feature flags, for example through setPropertiesLocation.
-
setEnabled
void setEnabled(String featureId, boolean enabled)
Toggles the feature for the current test only. Unlike the default implementation, it neither requires development mode nor stores the new state into the vaadin-featureflags.properties file of the project.
The new state is recorded among the overrides, so that it survives a later reload of the feature flags, exactly like the states declared by the test configuration.
-
-
-
-