Class CurationDraftDispositionsTest

java.lang.Object
ubic.gemma.model.common.auditAndSecurity.curation.CurationDraftDispositionsTest

public class CurationDraftDispositionsTest extends Object
Pure unit tests for CurationDraftDispositions. No Spring, no DB — just JSON-string to Disposition-map derivation.

Restored alongside the class in this change; the pre-fa4363e24f version built a CurationDraft with an embedded proposalSnapshotJson. The baseline is now the draft's parent PROPOSAL, so both the entity overload and the string overload are exercised.

  • Constructor Details

    • CurationDraftDispositionsTest

      public CurationDraftDispositionsTest()
  • Method Details

    • retained_whenProposalAndDraftEqual

      @Test public void retained_whenProposalAndDraftEqual()
    • edited_whenProposalAndDraftDiffer

      @Test public void edited_whenProposalAndDraftDiffer()
    • rejected_whenProposalHadKeyAndDraftDoesNot

      @Test public void rejected_whenProposalHadKeyAndDraftDoesNot()
    • parked_overridesDiff

      @Test public void parked_overridesDiff()
    • newInDraftOnly_isOmittedFromDispositionMap

      @Test public void newInDraftOnly_isOmittedFromDispositionMap()
    • emptyBothSides_stillSurfacesParkedKeys

      @Test public void emptyBothSides_stillSurfacesParkedKeys()
    • parkedElementAbsentFromBothSides_isStillListed

      @Test public void parkedElementAbsentFromBothSides_isStillListed()
    • nullDraft_returnsEmptyMap

      @Test public void nullDraft_returnsEmptyMap()
    • draftWithNoParent_reportsOnlyParked

      @Test public void draftWithNoParent_reportsOnlyParked()
      A draft with no parent has no diff baseline: every element reads as new, so nothing but parked keys can be reported. Distinguishes "seeded from a proposal and the curator kept everything" from "written from scratch".
    • keyOrderDoesNotMakeAnEdit

      @Test public void keyOrderDoesNotMakeAnEdit()
      Key order must not decide the verdict — the payloads are objects, and two objects with the same members are the same content.
    • malformedJsonIsTreatedAsAbsent

      @Test public void malformedJsonIsTreatedAsAbsent()
      Unparseable JSON degrades to "no baseline" rather than throwing: a corrupt payload must not take down the read of every other element.