Class GzipHeaderDecoratorTest
Content-Encoding decorators fires, for each shape of the GZIP annotation.
The distinction matters because the two run on opposite sides of Jersey's GZipEncoder:
GzipHeaderDecorator sets the header before it, which is what makes the encoder compress, while
GzipHeaderDecoratorAfterGZipEncoder sets it after, labelling a payload that is already compressed. Pick
the wrong one and the response is either double-compressed or labelled gzip while being plain text.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNeither decorator may leave a representation both unlabelled and uncompressed — that is the silent-regression shape, and it is what a dropped container annotation looks like from the outside.voidvoidvoidThe repeated-annotation case.voidvoidTheGET /resultSetslist route, driven off its real annotations rather than a fixture.void
-
Constructor Details
-
GzipHeaderDecoratorTest
public GzipHeaderDecoratorTest()
-
-
Method Details
-
unconditionalGzipIsHandledBeforeTheEncoder
- Throws:
IOException
-
preCompressedGzipIsHandledAfterTheEncoder
- Throws:
IOException
-
mediaTypeRestrictionIsHonoured
- Throws:
IOException
-
repeatedGzipCompressesJsonThroughTheEncoder
The repeated-annotation case. A method carrying two@GZIPreaches the interceptor as a single@GZIPscontainer; before it was unwrapped, neither decorator matched and the endpoint quietly lost compression on both representations.- Throws:
IOException
-
repeatedGzipLabelsTsvWithoutInvokingTheEncoder
- Throws:
IOException
-
everyRepresentationOfTheRepeatedShapeGetsExactlyOneDecorator
Neither decorator may leave a representation both unlabelled and uncompressed — that is the silent-regression shape, and it is what a dropped container annotation looks like from the outside.- Throws:
IOException
-
resultSetsListingIsCompressedThroughTheEncoder
TheGET /resultSetslist route, driven off its real annotations rather than a fixture.Every row of that listing repeats its parent
analysisand itsexperimentalFactorsverbatim, so the body is dominated by duplicated text: measured on gemma2 at?limit=20, 229,515 bytes uncompressed against 5,777 gzipped. Compression is the whole reason the route is affordable, and losing it is invisible from the response body — only the missingContent-Encodingheader shows it.- Throws:
IOException
-