mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +00:00
- Add cmd/mock-amazon/main.go (mirrors mock-spotify, uses testutils/amazon)
- Add amazon-mock service to docker-compose.yml (port 8082)
- Add AMAZON_CLIENT_ID/SECRET/TOKEN_URL/PROFILE_URL to docker-compose.ci.yml
- Add amazon_registration.http: registers account via /mgmt/amazon/callback
before the token-refresh test runs (mirrors spotify_registration.http)
- Update {{amazonRefreshToken}} in env to match mock response (Atzr|amazon-refresh-token)
- Log amazon-mock output on test failure in Makefile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.0 KiB
HTTP
36 lines
1.0 KiB
HTTP
### Amazon Music Initial Registration Flow
|
|
|
|
# @name Init Amazon Flow
|
|
POST {{host}}/mgmt/amazon/init
|
|
Authorization: Basic admin change_me!
|
|
|
|
> {%
|
|
client.global.set("redirectUrl", response.body.redirectUrl);
|
|
%}
|
|
|
|
###
|
|
|
|
# @name Amazon Callback
|
|
# Simulates the user being redirected back from Amazon LWA with a code
|
|
GET {{host}}/mgmt/amazon/callback?code=mock-auth-code
|
|
|
|
###
|
|
|
|
# @name Verify Accounts
|
|
GET {{host}}/mgmt/amazon/accounts
|
|
Authorization: Basic admin change_me!
|
|
|
|
> {%
|
|
client.test("Account exists", function() {
|
|
client.assert(response.body.accounts.length > 0, "No accounts found");
|
|
var found = false;
|
|
for (var i = 0; i < response.body.accounts.length; i++) {
|
|
if (response.body.accounts[i].user_id === "amzn1.account.TESTUSER") {
|
|
found = true;
|
|
client.assert(response.body.accounts[i].display_name === "Amazon Test User", "Display name mismatch");
|
|
break;
|
|
}
|
|
}
|
|
client.assert(found, "Account 'amzn1.account.TESTUSER' not found in " + JSON.stringify(response.body.accounts));
|
|
});
|
|
%} |