Class ExperimentSetsWebServiceTest

java.lang.Object
ubic.gemma.rest.ExperimentSetsWebServiceTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) public class ExperimentSetsWebServiceTest extends Object
Pure Mockito tests for ExperimentSetsWebService: the resource → service wiring, and the guards that decide what reaches the service at all.
Author:
gembro
  • Constructor Details

    • ExperimentSetsWebServiceTest

      public ExperimentSetsWebServiceTest()
  • Method Details

    • testListIsSortedAndPaged

      @Test public void testListIsSortedAndPaged()
    • testMineAsksForMineRatherThanFilteringAll

      @Test public void testMineAsksForMineRatherThanFilteringAll()
    • testTheListDoesNotLoadMembersUnlessAsked

      @Test public void testTheListDoesNotLoadMembersUnlessAsked()
      🛑 Members are off by default on the list. A set can hold thousands of datasets and the ids are the expensive part of the query; a list endpoint that loaded them for every set would make browsing sets cost the corpus.
    • testAnUnknownSetIs404

      @Test public void testAnUnknownSetIs404()
    • testCreateRequiresAName

      @Test public void testCreateRequiresAName()
      A create is a create: the name is the only thing the caller must supply, and a blank one is refused here rather than reaching the service, which would throw IllegalArgumentException and surface as a less specific error.
    • testCreatePassesTheMembersAndLeavesTheTaxonAlone

      @Test public void testCreatePassesTheMembersAndLeavesTheTaxonAlone()
      🛑 The taxon is NOT sent unless the caller declared one. Sending a derived or defaulted taxon would re-impose the constraint the service was just relaxed to make optional, and a mixed cohort — 179 human, 254 mouse, 16 rat in the gold reference set — would be refused again.
    • testEmptyMembershipEmptiesTheSet

      @Test public void testEmptyMembershipEmptiesTheSet()
      Replacing membership is a replace. An empty list empties the set, and it must reach the service rather than being read as "nothing to do" — the difference is a set that still holds its old members.
    • testMissingMembershipIsRefused

      @Test public void testMissingMembershipIsRefused()
      A missing datasetIds is not the same as an empty one, and must not silently empty the set.