Class PlatformsWebServiceMappingSummaryTest
java.lang.Object
ubic.gemma.rest.PlatformsWebServiceMappingSummaryTest
@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
public class PlatformsWebServiceMappingSummaryTest
extends Object
Pure-Mockito test for the
GET /platforms/{platform}/elements/{probe}/mappingSummary endpoint added
to PlatformsWebService. Replaces the legacy DWR
CompositeSequenceController.getGeneMappingSummary used by the gemma-web
gene-page Elements drill-down.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidA probe with no alignments must serialize as an EMPTY array, not an absent key — UIB cannot otherwise distinguish "this probe has no mappings" from "the feature is missing".voidThe regression guard that matters: the field must survive SERIALIZATION.voidvoidvoidsetUp()
-
Constructor Details
-
PlatformsWebServiceMappingSummaryTest
public PlatformsWebServiceMappingSummaryTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
mappingSummaryReturnsVoWithGeneMappingSummariesPopulated
@Test public void mappingSummaryReturnsVoWithGeneMappingSummariesPopulated() -
geneMappingSummariesSurviveSerialization
The regression guard that matters: the field must survive SERIALIZATION.The previous version of this test asserted on the in-JVM value object and passed for years while the endpoint shipped responses with no
geneMappingSummarieskey at all — the field carried@JsonIgnore(added 2022-09-26 in an OpenAPI cleanup, before this endpoint existed), so the service computed the summaries and Jackson discarded them. An object-level assertion cannot see that; only serializing can.- Throws:
Exception
-
emptyGeneMappingSummariesSerializeAsEmptyArray
@Test public void emptyGeneMappingSummariesSerializeAsEmptyArray()A probe with no alignments must serialize as an EMPTY array, not an absent key — UIB cannot otherwise distinguish "this probe has no mappings" from "the feature is missing". -
mappingSummaryThrows404WhenServiceReturnsNull
@Test public void mappingSummaryThrows404WhenServiceReturnsNull()
-