Class PlatformsWebServiceElementGenesCursorTest

java.lang.Object
ubic.gemma.rest.PlatformsWebServiceElementGenesCursorTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) public class PlatformsWebServiceElementGenesCursorTest extends Object
Unit tests for the cursor-pagination branch added to PlatformsWebService.getPlatformElementGenes(PlatformArg, CompositeSequenceArg, OffsetArg, LimitArg, CursorArg) as step 1l of CURSOR_PAGINATION_STEP1_PLAN.md. Pure Mockito — the goal is to verify the WebService routes cursor vs offset modes to the right helper and emits the right response wrapper, not to retest the DAO (covered by the broader DAO-cursor suite).

Mirrors the step 1j PlatformsWebServiceElementCursorTest structure (same web service file, same response wrappers). Differences:

  • This endpoint scopes the listing to a single {probe} (not an array of probes) and maps the listing to GeneValueObject via geneService::loadValueObject.
  • The offset variant returns Slice<Gene> (entities) and the WebService maps it to Slice<GeneValueObject> via Slice.map; the cursor variant does the same via CursorPage.map.
  • The cursor variant delegates to CompositeSequenceArgService.getGenesByCursor(CompositeSequenceArg, ArrayDesign, Cursor, int), which itself resolves the probe against the platform (mirroring the offset call probeArgService.getEntityWithPlatform(probeArg, ...)). The WebService also re-computes the echoed filter purely for the response wrapper.
Author:
phase3
  • Constructor Details

    • PlatformsWebServiceElementGenesCursorTest

      public PlatformsWebServiceElementGenesCursorTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • offsetModeRoutesToLegacyHelperAndReturnsFilteredPaginatedResponse

      @Test public void offsetModeRoutesToLegacyHelperAndReturnsFilteredPaginatedResponse()
    • cursorModeRoutesToCursorHelperAndReturnsFilteredCursorResponse

      @Test public void cursorModeRoutesToCursorHelperAndReturnsFilteredCursorResponse()
    • cursorModeDecodesCursorAndForwardsToArgService

      @Test public void cursorModeDecodesCursorAndForwardsToArgService()
    • cursorModeForwardsBothPlatformArgAndProbeArg

      @Test public void cursorModeForwardsBothPlatformArgAndProbeArg()
    • cursorModeEmptyPageProducesEmptyResponseWithNoNextCursor

      @Test public void cursorModeEmptyPageProducesEmptyResponseWithNoNextCursor()
    • cursorModeMapsGeneEntitiesToValueObjects

      @Test public void cursorModeMapsGeneEntitiesToValueObjects()