Enum Class Mode
- All Implemented Interfaces:
Serializable,Comparable<Mode>,Constable
@TestBean-declared override.
Selects how the JuneauBeanStoreExtension threads the overlay into the system under test. See
JuneauBeanStoreExtension for the full INJECT vs OVERLAY contracts.
See Also:
TestBean- The annotation that carries this mode selector.JuneauBeanStoreExtension- The JUnit 5 extension that honors this mode.
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
INJECT
Construction-time wiring — the default.The bean is wired into the SUT at construction time via the builder's
overridingBeanStore(...)setter; the SUT doesn't exist until the overlay is applied. The overlay is installed in theoverridingParentslot of the SUT's bean store at construction time and is universal — every bean type is eligible for replacement, including framework-managed ones that subsequently pin into per-op memoizers. Best for fresh-instance test isolation.INJECToverrides do not require the extension to be attached to an existing bean store. -
OVERLAY
Push/pop wiring on a live SUT.The bean is overlaid onto an already-constructed SUT for the duration of a test scope, then removed via
WritableBeanStore.popOverlay(org.apache.juneau.commons.inject.Snapshot). RequiresJuneauBeanStoreExtension.attach(org.apache.juneau.commons.inject.WritableBeanStore)to point the extension at the SUT's bean store; per-test overlays are pushed viaWritableBeanStore.pushOverlay(org.apache.juneau.commons.inject.BeanStore)atbeforeEach/beforeAlland popped atafterEach/afterAll. Best when SUT construction is expensive and tests share a live instance.OVERLAYoverrides only influence beans the framework resolves through the bean store per-call. Beans pinned into per-op memoizers at boot are not re-resolved — for those, useINJECT(fresh SUT).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-