Class GeneWebServiceProbesCursorTest

java.lang.Object
ubic.gemma.rest.GeneWebServiceProbesCursorTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) public class GeneWebServiceProbesCursorTest extends Object
Unit tests for the cursor-pagination branch added to GeneWebService.getGeneProbes(GeneArg, OffsetArg, LimitArg, CursorArg, boolean) as step 1m 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 1l PlatformsWebServiceElementGenesCursorTest structure, which is the symmetric endpoint (probe→genes; this one is gene→probes). Differences:

  • The offset variant already returns a Slice<CompositeSequenceValueObject> (the service does the VO mapping), so the WebService doesn't need a Slice.map(loadValueObject) call — both modes simply forward.
  • The response wrappers are the bare PaginatedResponseDataObject and CursorPaginatedResponseDataObject (no path-derived filter is echoed back — matches the existing offset wrapper).
  • The cursor variant delegates to GeneArgService.getGeneProbesByCursor(GeneArg, Cursor, int), which itself resolves the gene against the request (mirroring the offset call geneArgService.getGeneProbes(geneArg, ...)).
Author:
phase3
  • Constructor Details

    • GeneWebServiceProbesCursorTest

      public GeneWebServiceProbesCursorTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • offsetModeRoutesToLegacyHelperAndReturnsPaginatedResponse

      @Test public void offsetModeRoutesToLegacyHelperAndReturnsPaginatedResponse()
    • cursorModeRoutesToCursorHelperAndReturnsCursorResponse

      @Test public void cursorModeRoutesToCursorHelperAndReturnsCursorResponse()
    • cursorModeDecodesCursorAndForwardsToArgService

      @Test public void cursorModeDecodesCursorAndForwardsToArgService()
    • cursorModeForwardsGeneArgUnchanged

      @Test public void cursorModeForwardsGeneArgUnchanged()
    • cursorModeEmptyPageProducesEmptyResponseWithNoNextCursor

      @Test public void cursorModeEmptyPageProducesEmptyResponseWithNoNextCursor()
    • cursorModePreservesAscendingIdOrderFromDao

      @Test public void cursorModePreservesAscendingIdOrderFromDao()