### GET /streaming/account/{{accountId}}/device/{{deviceId}}/recents
GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/recents
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}

> {%
    client.test("Request executed successfully", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });

    client.test("Response content-type is correct", function() {
        var type = response.contentType.mimeType;
        client.assert(type === "application/vnd.bose.streaming-v1.2+xml", "Expected 'application/vnd.bose.streaming-v1.2+xml' but received '" + type + "'");
    });

    client.test("Response body structure", function() {
        var recents = response.body.getElementsByTagName("recents")[0];
        client.assert(recents !== null, "Missing 'recents' root element");

        var recentList = recents.getElementsByTagName("recent");
        client.assert(recentList.length > 0, "No 'recent' elements found");

        var recent = recentList[0];
        client.assert(recent.getAttribute("id").length > 0, "Missing or empty 'id' attribute on 'recent' element");

        client.assert(recent.getElementsByTagName("contentItemType")[0].textContent.length > 0, "Missing or empty 'contentItemType'");
        client.assert(recent.getElementsByTagName("createdOn")[0].textContent.length > 0, "Missing or empty 'createdOn'");
        client.assert(recent.getElementsByTagName("lastplayedat")[0].textContent.length > 0, "Missing or empty 'lastplayedat'");
        client.assert(recent.getElementsByTagName("location")[0].textContent.length > 0, "Missing or empty 'location'");
        client.assert(recent.getElementsByTagName("name")[0].textContent.length > 0, "Missing or empty 'name'");

        var source = recent.getElementsByTagName("source")[0];
        client.assert(source !== null, "Missing 'source' element");
        client.assert(source.getAttribute("id").length > 0, "Missing or empty 'source' id");
        client.assert(source.getAttribute("type").length > 0, "Missing or empty 'source' type");

        client.assert(source.getElementsByTagName("createdOn")[0].textContent.length > 0, "Missing or empty source 'createdOn'");

        var credential = source.getElementsByTagName("credential")[0];
        client.assert(credential.getAttribute("type").length > 0, "Missing or empty credential 'type'");
        client.assert(credential.textContent.length > 0, "Missing or empty credential value");

        client.assert(source.getElementsByTagName("name")[0] !== null, "Missing source 'name'");
        client.assert(source.getElementsByTagName("sourceproviderid")[0].textContent.length > 0, "Missing or empty source 'sourceproviderid'");
        client.assert(source.getElementsByTagName("sourcename")[0].textContent.length > 0, "Missing or empty source 'sourcename'");

        var sourceSettings = source.getElementsByTagName("sourceSettings")[0];
        client.assert(sourceSettings !== undefined, "Missing 'sourceSettings'");

        client.assert(source.getElementsByTagName("updatedOn")[0].textContent.length > 0, "Missing or empty source 'updatedOn'");
        client.assert(source.getElementsByTagName("username")[0].textContent.length > 0, "Missing or empty source 'username'");

        client.assert(recent.getElementsByTagName("sourceid")[0].textContent.length > 0, "Missing or empty 'sourceid'");
        client.assert(recent.getElementsByTagName("updatedOn")[0].textContent.length > 0, "Missing or empty 'updatedOn'");
    });
%}
