Files
Bose-SoundTouch/tests/integration/http-client/get_presets_conditional.http
T
Tobias GesellchenandClaude Opus 4.8 a974862b07 test(http-client): pin the ETag conditional-GET (304) contract (refs #451)
The speaker re-polls /full and the device presets with the ETag it last saw and
expects 304 Not Modified when nothing changed. Two self-contained flows capture
the current ETag and replay it via If-None-Match, asserting 304. This pins the
conditional-GET behaviour and the case-sensitive ETag header path (CLAUDE.md).

make test-http-client: 65 requests, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 19:11:24 +02:00

32 lines
1.3 KiB
HTTP

### GET .../device/{deviceId}/presets then re-GET with If-None-Match -> 304
###
### Same conditional-GET contract as /full, for the device presets resource: the
### speaker re-polls with its last ETag and the service answers 304 when the
### preset list is unchanged. Self-contained: capture the current ETag, replay.
### Prime: fetch presets and capture the ETag
GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/presets
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
> {%
client.test("Initial presets fetch is 200 with an ETag", function() {
client.assert(response.status === 200, "Response status is not 200, got " + response.status);
client.assert(response.headers.valueOf("ETag") !== null, "Response should carry an ETag header");
});
client.global.set("presetsEtag", response.headers.valueOf("ETag"));
%}
### Conditional GET with the captured ETag -> 304 Not Modified
GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/presets
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
If-None-Match: {{presetsEtag}}
> {%
client.test("Conditional presets fetch returns 304 Not Modified", function() {
client.assert(response.status === 304, "Response status is not 304, got " + response.status);
});
%}