Class BioAssaySamplePayloadShapeTest

java.lang.Object
ubic.gemma.model.expression.bioAssay.BioAssaySamplePayloadShapeTest

public class BioAssaySamplePayloadShapeTest extends Object
What GET /datasets/{dataset}/samples puts on the wire per assay.

That response is the experiment page's largest call — 5,381,688 bytes for the 278 assays of dataset 3937 — and most of its bulk was structure rather than data: one platform serialized in full 278 times, and seven statement keys carrying null on all 5,291 statements. These pin the shape so a field cannot drift back onto it unnoticed.

Author:
gembro
  • Constructor Details

    • BioAssaySamplePayloadShapeTest

      public BioAssaySamplePayloadShapeTest()
  • Method Details

    • authenticate

      @BeforeEach public void authenticate()
      ArrayDesignValueObject's constructor asks the security context what to expose, so a bare unit test needs an authentication even though nothing here is about authorization.
    • clearAuthentication

      @AfterEach public void clearAuthentication()
    • anAssaysPlatformIsProjectedToTheReferenceShape

      @Test public void anAssaysPlatformIsProjectedToTheReferenceShape() throws Exception
      The platform is named, not reproduced. The full VO is byte-identical across every assay of a dataset and was serialized once per assay: on dataset 3937 the two platform fields were 706,120 of 5,265,852 bytes, 13.4% of the response, most of it 278 copies of one 1.4 kB description. GET /datasets/{id}/platforms?original=true serves the full object once for a caller that wants the rest of it.
      Throws:
      Exception
    • anAssaysOriginalPlatformIsProjectedToo

      @Test public void anAssaysOriginalPlatformIsProjectedToo() throws Exception
      The same projection on the switched-from platform, which is the same object with the same bulk.
      Throws:
      Exception
    • aSubjectOnlyStatementOmitsThePredicateAndObjectHalves

      @Test public void aSubjectOnlyStatementOmitsThePredicateAndObjectHalves() throws Exception
      A statement with nothing said about it says nothing, rather than saying null seven times.

      This is the rule AbstractFactorValueValueObjectSerializer#writeStatement already applies when it emits the same VO by hand on the factor-value path: null reads as "this was cleared", and a subject-only statement has nothing to clear. The subject and category halves keep their nulls on the same reasoning — they describe a term that IS there.

      Throws:
      Exception
    • aPredicatedStatementStillCarriesItsPredicateAndObject

      @Test public void aPredicatedStatementStillCarriesItsPredicateAndObject() throws Exception
      And when something IS said, it is still said.
      Throws:
      Exception
    • aSampleNoLongerCarriesTheDeprecatedFactorsMap

      @Test public void aSampleNoLongerCarriesTheDeprecatedFactorsMap() throws Exception
      The deprecated factors map — factor id to factor name — is gone. It was superseded by the factorValues collection, which carries the factor on each value, and had no reader in any of the ten client repositories on this machine.
      Throws:
      Exception
    • statementsAreAbsentRatherThanEmptyWhenExcluded

      @Test public void statementsAreAbsentRatherThanEmptyWhenExcluded() throws Exception
      Statements are on by default. The opt-out drops them, and an opt-out that defaulted to off would put predicated sample characteristics back out of sight — which is the thing the collection was added to end.
      Throws:
      Exception