From 235e9b40310fa6481c72e5bd31502e1be8f23961 Mon Sep 17 00:00:00 2001 From: lckariyawasam Date: Fri, 3 Jan 2025 12:12:06 +0530 Subject: [PATCH] Remove assertions checking for email ids from /emails endpoint test Previously the last element of the result array returned from the /emails endpoint was checked to have the id of the email cloned in the test case above and the second last element was checked to be the email created in the first testcase. However on certain runs they are returned out of order, causing the test to fail unnecessarily. --- ballerina/tests/test.bal | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index df11563..a24c4d0 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -79,17 +79,13 @@ public function testRetrieveEmailEp() returns error? { } -@test:Config{dependsOn: [testCreateEmailEp]} +@test:Config{dependsOn: [testCreateEmailEp, testCloneEmailEp]} public function testEmailsEp() returns error? { CollectionResponseWithTotalPublicEmailForwardPaging|error response = hubspotClient->/marketing/v3/emails(); if response is CollectionResponseWithTotalPublicEmailForwardPaging { test:assertEquals(response.total, response.results.length()); - // Check that the newly created email and clone above is included - test:assertEquals(response.results[response.total - 1].id, cloneEmailId); - test:assertEquals(response.results[response.total - 2].id, testEmailId); - } else { test:assertFail("Failed to get response from /marketing/v3/emails"); }