Class UpdateGeoSourceMetadataCliTest
java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.cli.util.test.BaseCliTest5
ubic.gemma.apps.UpdateGeoSourceMetadataCliTest
@ContextConfiguration
@TestExecutionListeners(value=org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener.class,
mergeMode=MERGE_WITH_DEFAULTS)
public class UpdateGeoSourceMetadataCliTest
extends BaseCliTest5
The backfill writes the GEO document and nothing else, and it skips what is already done.
- Author:
- gembro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidA non-GEO experiment has no record to store.void...void🛑 The accession must be read from a THAWED experiment.voidResumable: what already has a document is not refetched, so an interrupted run continues.void🛑 The safety rule.void🛑 The corpus sweep is the point of this command, and it is what you get by default.
-
Constructor Details
-
UpdateGeoSourceMetadataCliTest
public UpdateGeoSourceMetadataCliTest()
-
-
Method Details
-
resetMocks
@AfterEach public void resetMocks() -
testItStoresTheDocumentAndNothingElse
@Test @WithMockUser public void testItStoresTheDocumentAndNothingElse()🛑 The safety rule. A corpus-wide refetch that also took GEO's experiment tags, sample characteristics or publications would overwrite curation on 23,000 datasets, and this is the only place that says it must not. It goes red if another effect is switched on here. -
testItSkipsAnExperimentThatAlreadyHasOne
@Test @WithMockUser public void testItSkipsAnExperimentThatAlreadyHasOne()Resumable: what already has a document is not refetched, so an interrupted run continues. -
testForceRefetchesEvenWhenOneIsStored
@Test @WithMockUser public void testForceRefetchesEvenWhenOneIsStored()... unless the caller says to replace it. -
testANonGeoExperimentIsSkippedRatherThanFailed
@Test @WithMockUser public void testANonGeoExperimentIsSkippedRatherThanFailed()A non-GEO experiment has no record to store. It is skipped rather than failed — counting thousands of them as errors would bury the fetches that really did fail. -
testItReadsTheAccessionFromTheThawedExperiment
@Test @WithMockUser public void testItReadsTheAccessionFromTheThawedExperiment()🛑 The accession must be read from a THAWED experiment. The batch task runs off the main thread with no session, so the instance it is handed is detached andee.getAccession()is an uninitialized proxy —LazyInitializationException: Could not initialize proxy [DatabaseEntry#…], on every experiment in the run, measured on production 2026-08-29.The other tests here cannot catch it: they build an experiment in memory, where the accession is a real object and reading it works whether or not anything was thawed. This one gives the un-thawed instance NO accession, so a CLI that reads it sees "not from GEO", skips, and never calls the fetch.
-
testTheDefaultRunVisitsEveryExperiment
@Test @WithMockUser @DirtiesContext(methodMode=BEFORE_METHOD) public void testTheDefaultRunVisitsEveryExperiment()🛑 The corpus sweep is the point of this command, and it is what you get by default.With
setAllIsLazy()the base class handed-alltoprocessAllExpressionExperiments(), whose default body is empty. Nothing was processed, nothing was logged beyond "Loading all expression experiments as a stub...", and the run reported success in 0 seconds — on production, with no output to suggest anything was wrong. Lazy-all belongs to the commands that replace a per-experiment sweep with one statement; this one has a GEO fetch per experiment.
-