Class CurationLockPersistenceIT
java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseIntegrationTest5
ubic.gemma.persistence.service.common.auditAndSecurity.curation.CurationLockPersistenceIT
Contract for the advisory curation lock.
The properties worth pinning are the ones that make it safe to be advisory: that a lapsed claim frees itself without a sweeper, that stealing is always available and records who was displaced, and above all that a refresh cannot quietly become an acquire.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe dataset the caller hands in is normally NOT in the session this service runs in — the REST layer resolves it first, andacquireopens its own.voidvoidvoidvoidThe rule that keeps autosave from being a weapon.voidvoidvoidvoidseed()A PreboardedExperiment rather than a full ExpressionExperiment: it is an Investigation, which is all the lock needs, and it carries no Taxon or ArrayDesign — so the seed does not depend on reference data that a schema rebuilt from the entities does not have.voidvoidvoidMethods inherited from class BaseIntegrationTest5
setUpAuthentication, tearDownSecurityContext
-
Constructor Details
-
CurationLockPersistenceIT
public CurationLockPersistenceIT()
-
-
Method Details
-
seed
@BeforeEach public void seed()A PreboardedExperiment rather than a full ExpressionExperiment: it is an Investigation, which is all the lock needs, and it carries no Taxon or ArrayDesign — so the seed does not depend on reference data that a schema rebuilt from the entities does not have. -
unlocked_readsAsFree
@Test @DisplayName("an unlocked dataset reads as free") public void unlocked_readsAsFree() -
sameCuratorReacquires
@Test @DisplayName("acquire then re-acquire by the same curator refreshes rather than conflicting") public void sameCuratorReacquires() -
secondCuratorRefusedWithoutSteal
@Test @DisplayName("a second curator is refused unless they ask to steal") public void secondCuratorRefusedWithoutSteal() -
stealSucceedsAndRecordsTheDisplacedHolder
@Test @DisplayName("stealing always succeeds and records who was displaced") public void stealSucceedsAndRecordsTheDisplacedHolder() -
expiredLockReadsAsFree
@Test @DisplayName("an expired lock frees itself, with no sweeper") public void expiredLockReadsAsFree() -
takingOverALapsedClaimIsNotASteal
@Test @DisplayName("taking over a lapsed claim is not recorded as a steal") public void takingOverALapsedClaimIsNotASteal() -
refreshIsNotAnAcquire
@Test @DisplayName("refresh never becomes an acquire") public void refreshIsNotAnAcquire()The rule that keeps autosave from being a weapon. Refresh is called on every keystroke burst; if it could create or take over a lock, a curator with a stale tab open would steal it back from whoever now holds it without anyone touching a button. -
refreshExtendsTheHoldersLease
@Test @DisplayName("refresh extends the holder's own lease") public void refreshExtendsTheHoldersLease() -
releaseRequiresTheHolder
@Test @DisplayName("release is the holder's alone; forceRelease is not") public void releaseRequiresTheHolder() -
forceReleaseClearsAnyHolder
@Test @DisplayName("forceRelease clears whoever holds it") public void forceReleaseClearsAnyHolder() -
acquireWithADetachedInvestigation
@Test @DisplayName("a detached investigation can still be locked") public void acquireWithADetachedInvestigation()The dataset the caller hands in is normally NOT in the session this service runs in — the REST layer resolves it first, andacquireopens its own. Every other test here seeds the investigation through the same session it then locks, so the entity is managed and this case never arises; evicting first is what puts the service in the state a real request puts it in.It regressed exactly there.
CurationLockderives its identifier from the association with@MapsId, so Hibernate cascades the persist through it, and a detached investigation isdetached entity passed to persist— a 500 on the first acquire for any dataset, with the whole lock surface (take, steal, refresh-extends-lease, sign, and every commit that has to hold a lock) failing behind it. This class passed throughout, because a managed entity is the one thing it always had.
-