Class DatasetsWebServiceTicketsBulkTest
java.lang.Object
ubic.gemma.rest.DatasetsWebServiceTicketsBulkTest
@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
public class DatasetsWebServiceTicketsBulkTest
extends Object
Unit tests for
DatasetsWebService.getDatasetTicketsBulk(DatasetsWebService.DatasetTicketsBulkRequest) — the bulk read behind the
experiment list's "on a ticket" glyph. Pure Mockito: the grouping, the presence contract and the
open-state scope are pinned against real MySQL in TicketPersistenceIT; what is tested here
is what only the route can get wrong — the order of the ACL filter against the ticket
lookup, and the request guards.- Author:
- gembro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidNothing readable is an empty map, and no reason to run the ticket query at all.voidOver the cap is a 400 that names the cap, not a request that quietly truncates the page.voidA repeated id must not become a repeated key or a doubled ticket list; the other two bulk dataset reads deduplicate the same way.void🛑 The ticket table carries no ACL of its own, so the readability filter has to run BEFORE the lookup, not after it.
-
Constructor Details
-
DatasetsWebServiceTicketsBulkTest
public DatasetsWebServiceTicketsBulkTest()
-
-
Method Details
-
unreadableDatasetsNeverReachTheTicketLookup
@Test public void unreadableDatasetsNeverReachTheTicketLookup()🛑 The ticket table carries no ACL of its own, so the readability filter has to run BEFORE the lookup, not after it. Asking about a dataset the caller cannot see must not reach the ticket query at all — otherwise "is this under review" is answerable about a private dataset. -
noReadableDatasetsShortCircuits
@Test public void noReadableDatasetsShortCircuits()Nothing readable is an empty map, and no reason to run the ticket query at all. -
repeatedIdsAreDeduplicated
@Test public void repeatedIdsAreDeduplicated()A repeated id must not become a repeated key or a doubled ticket list; the other two bulk dataset reads deduplicate the same way. -
missingOrEmptyBodyIsRefused
@Test public void missingOrEmptyBodyIsRefused() -
overTheCapIsRefusedRatherThanTruncated
@Test public void overTheCapIsRefusedRatherThanTruncated()Over the cap is a 400 that names the cap, not a request that quietly truncates the page.
-