Class BioAssayFactory
java.lang.Object
ubic.gemma.core.util.test.fixture.BioAssayFactory
Typed factory for persistent
BioAssay test fixtures.
Phase 3 split-out from the inline BA construction inside
ExperimentFactory.Builder.build(). Use this factory when a test
needs an isolated, persistent BioAssay (not necessarily attached
to an ExpressionExperiment);
for the EE-attached case keep using ExperimentFactory.
Usage:
// Fresh BA with auto-created BioMaterial + ArrayDesign on mouse
BioAssay ba = bioAssayFactory.builder().build();
// BA wired to a specific BM and AD
BioAssay ba = bioAssayFactory.builder()
.withBioMaterial(bm)
.withArrayDesign(ad)
.build();
// Named BA
BioAssay ba = bioAssayFactory.builder()
.withName("GSM12345_ba")
.build();
Design notes (HB6-relevant):
- The BA mapping does NOT cascade from
BioAssaytosampleUsed/arrayDesignUsed. Both must be persistent beforeSecurableBaseImmutableService.create(BioAssay)is called. This factory pre-persists both via their respective services so the production code path fires (ACL listeners on the BM and AD). BioMaterial.getBioAssaysUsedIn().add(ba)is the collection mutation that keeps the inverse side in sync. We do this BEFORE the BA persist so subsequent loads see the relationship.- A transient GEO
DatabaseEntryaccession is attached to every BA - mirrors the inline pattern in ExperimentFactory and satisfies tests that filter on accession. BioMaterialFactorydoes not yet exist as a separate component; until it lands, this factory inlines BM creation (same shape asExperimentFactory's inline BM block). TheBioAssayFactory.Builder.withBioMaterial(BioMaterial)hook is the seam to swap in onceBioMaterialFactorylands.
- Author:
- Phase 3 (Vision section 3 - test-fixture rewrite)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BioAssayFactory
public BioAssayFactory()
-
-
Method Details
-
builder
Start building aBioAssay. All defaults can be overridden viawithXxx(...)methods.
-