Class DatasetsWebServiceSamplesCursorTest
DatasetsWebService.getDatasetSamples(DatasetArg, QuantitationTypeArg, boolean, CursorArg, LimitArg, ExcludeArg, boolean)
as step 1k of CURSOR_PAGINATION_STEP1_PLAN.md. Pure Mockito — the goal is to
verify the WebService routes cursor vs legacy modes to the right helper and emits the
right response wrapper, not to retest the DAO (covered by the broader DAO-cursor
suite).
Differences from the previous 1e-1j cursor tests:
- The legacy mode is NOT offset-paginated for this endpoint — it returns an
unpaginated ResponseDataObject<List<BioAssayValueObject>>. The
cursor branch is therefore strictly additive (an opt-in via ?cursor= or
?limit=; either one selects it, and a bare limit starts at the
first page with a null cursor).
- The endpoint also accepts quantitationType and
useProcessedQuantitationType that select QT-narrowed assay listings; these
intentionally remain in the legacy unpaginated mode (their sort and dimension
restriction are not expressible as an id-only cursor under the step 1b restriction),
so supplying cursor or limit together with either is a 400 Bad Request.
- Author:
- phase3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidCursor mode still has a page size when the caller sends none — dropping@DefaultValue("20")from the parameter moved that default into the method, and it has to still be there.voidvoidvoidvoidAlimitwith nocursorstarts a cursor walk at the first page, which is the only way into cursor mode from a standing start: this listing has no offset mode, so nothing it can return without a cursor carries anextCursorto continue from.voidThe QT-narrowed listings stay unpaginated — they sort by assay name and restrict to aBioAssayDimension, neither of which an id-only cursor can express — so alimitthere is refused rather than dropped, on the same grounds as acursor.voidsetUp()
-
Constructor Details
-
DatasetsWebServiceSamplesCursorTest
public DatasetsWebServiceSamplesCursorTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
legacyModeWithoutCursorReturnsUnpaginatedResponseDataObject
@Test public void legacyModeWithoutCursorReturnsUnpaginatedResponseDataObject() -
cursorModeRoutesToCursorHelperAndReturnsCursorPaginatedResponse
@Test public void cursorModeRoutesToCursorHelperAndReturnsCursorPaginatedResponse() -
cursorModeDecodesCursorAndForwardsToArgService
@Test public void cursorModeDecodesCursorAndForwardsToArgService() -
cursorWithQuantitationTypeIsRejectedAs400
@Test public void cursorWithQuantitationTypeIsRejectedAs400() -
limitWithoutCursorStartsACursorWalkAtTheFirstPage
@Test public void limitWithoutCursorStartsACursorWalkAtTheFirstPage()Alimitwith nocursorstarts a cursor walk at the first page, which is the only way into cursor mode from a standing start: this listing has no offset mode, so nothing it can return without a cursor carries anextCursorto continue from.It also makes a short answer possible at all. Measured on production (
gemma2, dataset 7332 = GSE2109, 2158 samples),GET /datasets/7332/samples?limit=20used to answer with all 2158 assays — the same body as the no-parameter call, 22,846,518 bytes at the time — with nothing in it saying the page size had been dropped. Truncating the unpaginatedResponseDataObjectto 20 would have been no better, since it has nototalElementsand nonextCursorin which to declare that 2138 rows were left out; the cursor wrapper does. -
limitWithQuantitationTypeAndNoCursorIsRejectedAs400
@Test public void limitWithQuantitationTypeAndNoCursorIsRejectedAs400()The QT-narrowed listings stay unpaginated — they sort by assay name and restrict to aBioAssayDimension, neither of which an id-only cursor can express — so alimitthere is refused rather than dropped, on the same grounds as acursor. -
cursorModeWithoutLimitUsesTheDefaultPageSize
@Test public void cursorModeWithoutLimitUsesTheDefaultPageSize()Cursor mode still has a page size when the caller sends none — dropping@DefaultValue("20")from the parameter moved that default into the method, and it has to still be there. -
cursorWithUseProcessedQuantitationTypeIsRejectedAs400
@Test public void cursorWithUseProcessedQuantitationTypeIsRejectedAs400()
-