Class PlatformsWebServiceTest

java.lang.Object
org.glassfish.jersey.test.JerseyTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class PlatformsWebServiceTest extends BaseJerseyIntegrationTest5
  • Constructor Details

    • PlatformsWebServiceTest

      public PlatformsWebServiceTest()
  • Method Details

    • setUpMocks

      @BeforeEach public void setUpMocks()
    • removeFixtures

      @AfterEach public void removeFixtures()
    • testAll

      @Test public void testAll()
    • testPlatformDatasets

      @Test public void testPlatformDatasets()
    • testPlatformElements

      @Test public void testPlatformElements()
    • testPlatformVoNamesItsMergeTargetAndItsMergees

      @Test public void testPlatformVoNamesItsMergeTargetAndItsMergees()
      Ask 3: a mergee must be able to NAME its merge target. isMergee said only THAT a merge happened, and mergees.id is not a filterable property, so from the mergee's side — the side a visitor stands on — the target was unreachable.
    • testMicroarrayGeneCountsAreNullWithoutAReport

      @Test public void testMicroarrayGeneCountsAreNullWithoutAReport()
      Ask 4, microarray case. The counts come from the on-disk report, which is written by the pipeline / the monthly job — never computed per request, because counting distinct genes for one large platform measured ~1.7s against production. With no report on disk the fields stay NULL rather than 0: "not computed yet" and "maps to no genes" are different claims, and falling back to the slow query is exactly what this design refuses to do.
    • testGeneListPlatformGeneCountsComeFromTheElementCount

      @Test public void testGeneListPlatformGeneCountsComeFromTheElementCount()
      Ask 4, RNA-seq case. A gene-list platform's elements ARE genes, so both counts equal the element count and neither needs a report — which is what makes this path work on a deployment where no reports have been generated yet.
    • testPlatformElementRestrictsToTheRequestedProbe

      @Test public void testPlatformElementRestrictsToTheRequestedProbe()
      Regression guard for the {probes} restriction being dropped.

      CompositeSequenceArrayArg.getPlatformFilter() encodes only arrayDesign.id = ?; until 2026-08-22 the endpoint composed that alone, so asking for ONE probe by name returned the platform's first page instead. The bug was invisible to the existing tests because they all mock the arg-service — this one goes through real persistence and asserts on identity, which is the only thing that can catch it.

    • testPlatformElementsWithGenesYieldsEmptyListNotNull

      @Test public void testPlatformElementsWithGenesYieldsEmptyListNotNull()
      withGenes=true must set the field on every row, and to an EMPTY list rather than null for a probe with no gene mapping — otherwise NON_NULL elides it and the client cannot tell "maps to nothing" from "not requested". The seeded fixture has no GENE2CS rows, so this pins the empty-not-null half specifically.
    • testPlatformElementsWithoutGenesLeavesFieldNull

      @Test public void testPlatformElementsWithoutGenesLeavesFieldNull()
      Without the opt-in the field stays null, so it elides from the wire entirely — the existing default response shape is unchanged for callers that never ask.
    • testPlatformElementsHonoursNameFilter

      @Test public void testPlatformElementsHonoursNameFilter()
      A user filter= must narrow the listing. Pinned because the endpoint accepted no filter at all until 2026-08-22 — an unknown query param is silently ignored by JAX-RS, so the UI's search box appeared to run and matched everything.
    • testPlatformElementsWithSequence

      @Test public void testPlatformElementsWithSequence()
    • testGetBlacklistedPlatforms

      @Test public void testGetBlacklistedPlatforms()
    • testGetBlacklistedPlatformsAsNonAdmin

      @Test public void testGetBlacklistedPlatformsAsNonAdmin()
    • testPlatformAnnotationsServesEachFileType

      @Test public void testPlatformAnnotationsServesEachFileType() throws IOException
      The endpoint served the standard flavour unconditionally until the type parameter existed, so the _bioProcess / _noParents files that create() writes on every GO-enabled run were unreachable. Each type must now resolve to its own file.

      Files are planted on disk so the miss path never fires: generation needs GO loaded, which this context does not have, and the point here is the file-name resolution, not the generator.

      Throws:
      IOException
    • testPlatformAnnotationsRejectsAnUnknownFileType

      @Test public void testPlatformAnnotationsRejectsAnUnknownFileType()
      An unknown type is a 400 naming the accepted values, not a silent fallback to the standard file — a caller asking for bioProcess must not be handed every GO term with nothing in the response to say so. Rejected before the platform is even looked up.