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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Applicationprotected org.glassfish.jersey.test.spi.TestContainerFactoryvoidsetUp()voidtearDown()voidvoidvoidvoidvoidvoidA 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.voidA 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.voidvoidThe reported case:idsis not a parameter of /datasets, was dropped, and the whole corpus came back reported as the caller's selection.Methods inherited from class org.glassfish.jersey.test.JerseyTest
client, close, closeIfNotNull, configureClient, configureDeployment, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, getSslContext, getSslParameters, isEnabled, set, set, setClient, target, target
-
Constructor Details
-
UnknownQueryParameterFilterTest
public UnknownQueryParameterFilterTest()
-
-
Method Details
-
setUp
-
tearDown
-
getTestContainerFactory
protected org.glassfish.jersey.test.spi.TestContainerFactory getTestContainerFactory() throws org.glassfish.jersey.test.spi.TestContainerException- Overrides:
getTestContainerFactoryin classorg.glassfish.jersey.test.JerseyTest- Throws:
org.glassfish.jersey.test.spi.TestContainerException
-
configure
public jakarta.ws.rs.core.Application configure()- Overrides:
configurein classorg.glassfish.jersey.test.JerseyTest
-
testDeclaredParametersAreAccepted
@Test public void testDeclaredParametersAreAccepted() -
testNoParametersAtAllIsAccepted
@Test public void testNoParametersAtAllIsAccepted() -
testUnknownParameterIsRejectedAndNamed
@Test public void testUnknownParameterIsRejectedAndNamed()The reported case:idsis 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.
-