diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..8fce603 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +data/ diff --git a/tests/integration/http-client/create_account.http b/tests/integration/http-client/create_account.http index 57405ee..cb93869 100644 --- a/tests/integration/http-client/create_account.http +++ b/tests/integration/http-client/create_account.http @@ -22,7 +22,6 @@ Content-Type: application/vnd.bose.customer-v1.0+xml if (client.variables.environment.get("accountId")) { client.assert(accountId === client.variables.environment.get("accountId"), "Account ID "+accountId+" should match environment variable if provided"); } - client.global.set("newAccountId", accountId); }); %} @@ -40,6 +39,5 @@ Content-Type: application/vnd.bose.streaming-v1.2+xml client.test("Login successful", function() { client.assert(response.status === 200, "Response status is not 200"); client.assert(response.headers.valueOf("Credentials") !== null, "Credentials header missing"); - client.global.set("authToken", response.headers.valueOf("Credentials")); }); %} diff --git a/tests/integration/http-client/get_full_account.http b/tests/integration/http-client/get_full_account.http index c7a0f62..4149273 100644 --- a/tests/integration/http-client/get_full_account.http +++ b/tests/integration/http-client/get_full_account.http @@ -1,7 +1,7 @@ -### GET /streaming/account/{{newAccountId}}/full -GET {{host}}/streaming/account/{{newAccountId}}/full +### GET /streaming/account/{{accountId}}/full +GET {{host}}/streaming/account/{{accountId}}/full Host: streaming.bose.com -Authorization: Bearer {{authToken}} +Authorization: Bearer {{token}} Content-Type: application/vnd.bose.streaming-v1.2+xml User-Agent: Bose_Lisa/27.0.6 Accept: application/vnd.bose.streaming-v1.2+xml @@ -13,7 +13,7 @@ Accept: application/vnd.bose.streaming-v1.2+xml }); client.test("Response body contains ", function() { - const expectedAccountId = client.global.get("newAccountId") || client.variables.environment.get("accountId"); + const expectedAccountId = client.variables.environment.get("accountId"); const doc = response.body; const account = doc.getElementsByTagName("account")[0]; client.assert(account !== undefined, "Response body does not contain "); diff --git a/tests/integration/http-client/get_group.http b/tests/integration/http-client/get_group.http index 63f85e6..f4a2d5b 100644 --- a/tests/integration/http-client/get_group.http +++ b/tests/integration/http-client/get_group.http @@ -1,10 +1,10 @@ -### GET /streaming/account/{{newAccountId}}/device/{{deviceId}}/group/ -GET {{host}}/streaming/account/{{newAccountId}}/device/{{deviceId}}/group/ +### GET /streaming/account/{{accountId}}/device/{{deviceId}}/group/ +GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/group/ Host: streaming.bose.com Content-Type: application/vnd.bose.streaming-v1.2+xml User-Agent: Bose_Lisa/27.0.6 Accept: application/vnd.bose.streaming-v1.2+xml -Authorization: Bearer {{authToken}} +Authorization: Bearer {{token}} > {% client.test("Request executed successfully", function() { diff --git a/tests/integration/http-client/get_provider_settings.http b/tests/integration/http-client/get_provider_settings.http index 8b36c23..cf3ceb2 100644 --- a/tests/integration/http-client/get_provider_settings.http +++ b/tests/integration/http-client/get_provider_settings.http @@ -1,8 +1,8 @@ -### GET /streaming/account/{{newAccountId}}/provider_settings -GET {{host}}/streaming/account/{{newAccountId}}/provider_settings +### GET /streaming/account/{{accountId}}/provider_settings +GET {{host}}/streaming/account/{{accountId}}/provider_settings Host: streaming.bose.com Accept: application/vnd.bose.streaming-v1.2+xml -Authorization: Bearer {{authToken}} +Authorization: Bearer {{token}} Content-Type: application/vnd.bose.streaming-v1.2+xml User-Agent: Bose_Lisa/27.0.6 diff --git a/tests/integration/http-client/power_on.http b/tests/integration/http-client/power_on.http index da66209..8c45d4d 100644 --- a/tests/integration/http-client/power_on.http +++ b/tests/integration/http-client/power_on.http @@ -3,7 +3,7 @@ POST {{host}}/streaming/support/power_on Host: streaming.bose.com User-Agent: Bose_Lisa/27.0.6 Accept: application/vnd.bose.streaming-v1.2+xml -Authorization: Bearer {{authToken}} +Authorization: Bearer {{token}} Content-Type: application/vnd.bose.streaming-v1.2+xml {{serialNumber}}27.0.6.46330.5043500 epdbuild.trunk.hepdswbld04.2022-08-04T11:20:29{{productSerialNumber}}Excellent{{gatewayIp}}{{macAddress1}}{{macAddress2}}{{deviceIp}}Wireless diff --git a/tests/integration/http-client/register_device.http b/tests/integration/http-client/register_device.http index ae34e57..ecd7f63 100644 --- a/tests/integration/http-client/register_device.http +++ b/tests/integration/http-client/register_device.http @@ -1,7 +1,7 @@ -### POST /{{newAccountId}}/devices (Register Device) -POST {{host}}/accounts/{{newAccountId}}/devices +### POST /{{accountId}}/devices (Register Device) +POST {{host}}/accounts/{{accountId}}/devices Content-Type: application/vnd.bose.streaming-v1.2+xml -Authorization: Bearer {{authToken}} +Authorization: Bearer {{token}} diff --git a/tests/integration/http-client/unregister_device.http b/tests/integration/http-client/unregister_device.http index 18ddffe..b75ce5c 100644 --- a/tests/integration/http-client/unregister_device.http +++ b/tests/integration/http-client/unregister_device.http @@ -1,6 +1,6 @@ -### DELETE /{{newAccountId}}/devices/{{deviceId}} (Unregister Device) -DELETE {{host}}/accounts/{{newAccountId}}/devices/{{deviceId}} -Authorization: Bearer {{authToken}} +### DELETE /{{accountId}}/devices/{{deviceId}} (Unregister Device) +DELETE {{host}}/accounts/{{accountId}}/devices/{{deviceId}} +Authorization: Bearer {{token}} > {% client.test("Device unregistered successfully", function() {