Class FactorValueValueObjectSerializerTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe baseline designation reaches the wire.voidA compound statement reaches the wire flattened: two entries instatementssharing one subject, the second clause carryingsecondPredicate/secondObjectunder the genericpredicate/objectkeys.voidA factor value's OWN evidence reaches the wire, distinct from its statements'.voidAbsent, not false, when nothing was designated.voidEvidence reaches the wire on the design payload.void🛑 A grounded value with no predicate is still a statement, and it has to appear instatements.voidAbsent, not null, when there is no evidence — null reads as "this was cleared" on a payload whose write path treats an empty send as an erasure.voidtest()
-
Constructor Details
-
FactorValueValueObjectSerializerTest
public FactorValueValueObjectSerializerTest()
-
-
Method Details
-
test
- Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionParseException
-
aBaselineFactorValueSaysSoOnTheWire
@Test public void aBaselineFactorValueSaysSoOnTheWire() throws com.fasterxml.jackson.core.JsonProcessingExceptionThe baseline designation reaches the wire.This serializer replaces the bean path for every factor value the API returns, and it hand-writes the fields — so the
@JsonProperty("isBaseline")on the VO was dead, and no endpoint said which factor value was the reference level even though 665 rows on prod are marked. A design GET could not tell a curator, and a GET → PUT round-trip could not carry the designation back.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
anUndesignatedFactorValueOmitsTheFlagRatherThanSayingFalse
@Test public void anUndesignatedFactorValueOmitsTheFlagRatherThanSayingFalse() throws com.fasterxml.jackson.core.JsonProcessingExceptionAbsent, not false, when nothing was designated. The flag is three-valued on write — null means "no change" — so a renderedfalsehas to keep meaning "explicitly not the baseline".- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
aStatementWithNothingSaidAboutItStillAppearsInStatements
@Test public void aStatementWithNothingSaidAboutItStillAppearsInStatements() throws com.fasterxml.jackson.core.JsonProcessingException🛑 A grounded value with no predicate is still a statement, and it has to appear instatements.It used to appear only under
characteristics, so the commonest annotation in the corpus —organism part: chorionic villus— arrived asstatements: []. Three teams read that as "this factor value has no statement" on 2026-08-28: a write-back was diagnosed against the wrong cause, and a grounded UBERON term rendered as free text on every organism-part value of one dataset.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
aCompoundStatementIsFlattenedIntoTwoStatementsRatherThanExposingTheSecondClauseFields
@Test public void aCompoundStatementIsFlattenedIntoTwoStatementsRatherThanExposingTheSecondClauseFields() throws com.fasterxml.jackson.core.JsonProcessingExceptionA compound statement reaches the wire flattened: two entries instatementssharing one subject, the second clause carryingsecondPredicate/secondObjectunder the genericpredicate/objectkeys.This pins the reason the four
second*fields onStatementValueObjectare annotated@WithheldFromApi(REDUNDANT): the data is already published, under another name, by this serializer. Un-hide them and a client reading both shapes sees the second clause twice. The behaviour dates todff752727c(fix #814), which un-hidpredicate*/object*and added this flattening in the same commit.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
aStatementCarriesItsEvidenceOnTheWire
@Test public void aStatementCarriesItsEvidenceOnTheWire() throws com.fasterxml.jackson.core.JsonProcessingExceptionEvidence reaches the wire on the design payload.StatementValueObjectdeclaressupportingEvidenceandevidenceCodeand populates both from the entity, but this serializer replaces the bean path and hand-writes each field — so neither key was emitted understatements[]while/annotationsreturned them for the same row. The consequence was not cosmetic: on the write pathsupportingEvidence: []ERASES, so a client that could not read the current value had no safe way to merge into it.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
aFactorValueCarriesItsOwnEvidenceOnTheWire
@Test public void aFactorValueCarriesItsOwnEvidenceOnTheWire() throws com.fasterxml.jackson.core.JsonProcessingExceptionA factor value's OWN evidence reaches the wire, distinct from its statements'.Declared on
AbstractFactorValueValueObjectand inherited by both concrete VOs, so it appears in the OpenAPI schema forFactorValueValueObject— while the hand-written serializer dropped it, so a curator's evidence on the factor value itself was write-only.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
aStatementWithoutEvidenceOmitsTheKeys
@Test public void aStatementWithoutEvidenceOmitsTheKeys() throws com.fasterxml.jackson.core.JsonProcessingExceptionAbsent, not null, when there is no evidence — null reads as "this was cleared" on a payload whose write path treats an empty send as an erasure.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-