Class UnknownQueryParameterFilterTest

java.lang.Object
org.glassfish.jersey.test.JerseyTest
ubic.gemma.rest.providers.UnknownQueryParameterFilterTest

public class UnknownQueryParameterFilterTest extends org.glassfish.jersey.test.JerseyTest
Pins the rejection of query parameters a resource method cannot bind, and — just as importantly — the four cases that must keep working: a declared parameter, a path parameter, a route that reads the query string itself, and a route that has been annotated to opt out.
  • Constructor Details

    • UnknownQueryParameterFilterTest

      public UnknownQueryParameterFilterTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp() throws Exception
      Overrides:
      setUp in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception
    • tearDown

      @AfterEach public void tearDown() throws Exception
      Overrides:
      tearDown in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception
    • getTestContainerFactory

      protected org.glassfish.jersey.test.spi.TestContainerFactory getTestContainerFactory() throws org.glassfish.jersey.test.spi.TestContainerException
      Overrides:
      getTestContainerFactory in class org.glassfish.jersey.test.JerseyTest
      Throws:
      org.glassfish.jersey.test.spi.TestContainerException
    • configure

      public jakarta.ws.rs.core.Application configure()
      Overrides:
      configure in class org.glassfish.jersey.test.JerseyTest
    • testDeclaredParametersAreAccepted

      @Test public void testDeclaredParametersAreAccepted()
    • testNoParametersAtAllIsAccepted

      @Test public void testNoParametersAtAllIsAccepted()
    • testUnknownParameterIsRejectedAndNamed

      @Test public void testUnknownParameterIsRejectedAndNamed()
      The reported case: ids is not a parameter of /datasets, was dropped, and the whole corpus came back reported as the caller's selection.
    • testEveryUnknownParameterIsNamedNotJustTheFirst

      @Test public void testEveryUnknownParameterIsNamedNotJustTheFirst()
    • testEndpointDeclaringNoParametersSaysSo

      @Test public void testEndpointDeclaringNoParametersSaysSo()
    • testPathParameterIsNotAnAcceptedQueryParameter

      @Test public void testPathParameterIsNotAnAcceptedQueryParameter()
      A path parameter is bound from the path, so it must not be mistaken for a declared query parameter, and its presence must not widen what the query string may carry.
    • testAnnotatedRouteAcceptsAnythingItIsGiven

      @Test public void testAnnotatedRouteAcceptsAnythingItIsGiven()
    • testRouteHoldingUriInfoAcceptsAnythingItIsGiven

      @Test public void testRouteHoldingUriInfoAcceptsAnythingItIsGiven()
    • testPreflightIsNotRejected

      @Test public void testPreflightIsNotRejected()
      A CORS preflight is sent to the URL of the request it is asking about, query string included, so rejecting it would take the browser client down rather than the bad parameter.