Class EeWriteServiceImplQtDedupTest


public class EeWriteServiceImplQtDedupTest extends BaseSpringContextTest5
Pins the behaviourally load-bearing QuantitationType dedup semantic that was lifted out of CommonPersister.persistQuantitationType into a per-EE local map in EeWriteServiceImpl.

Why this test exists: AbstractPersister.persist runs under FlushMode.MANUAL so a DAO find cannot see an in-flight create. Without the local map, N data vectors sharing the same (name, description) QT would each trigger a fresh DAO create — N duplicate rows. The dedup key matches BusinessKey.matches(QT,QT) semantics: hashCode(name) + hashCode(description).

Author:
Phase 3 (persister QT cache lift)
  • Constructor Details

    • EeWriteServiceImplQtDedupTest

      public EeWriteServiceImplQtDedupTest()
  • Method Details

    • testQuantitationTypeDedupWithinSingleEePersist

      @Test @Transactional public void testQuantitationTypeDedupWithinSingleEePersist()
      Three equal-by-(name, description) QT instances hitting the helper with one shared local map must all resolve to the SAME persistent QT entity, and only one QUANTITATION_TYPE row must be inserted.
    • testQuantitationTypesWithDifferentDescriptionsAreNotDeduped

      @Test @Transactional public void testQuantitationTypesWithDifferentDescriptionsAreNotDeduped()
      Distinct-by-(name, description) QT instances hitting the helper with one shared map must each produce a separate persistent row — the dedup is keyed on (name, description), not on object identity.