Skip to content

Commit

Permalink
Live tests disabled running.
Browse files Browse the repository at this point in the history
  • Loading branch information
harithmaduranga committed Jan 17, 2025
1 parent f219c95 commit 3dd6470
Showing 1 changed file with 39 additions and 11 deletions.
50 changes: 39 additions & 11 deletions ballerina/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ OAuth2RefreshTokenGrantConfig auth = {
credentialBearer: oauth2:POST_BODY_BEARER
};

final Client hubspotClient = check new (config = {auth});
final Client hubspotClient = check new ({auth});

string testQuoteId = "";
string testQuoteId = "";

boolean enableLiveServerTest = false;

// Test function for creating a quote
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testCreateNewQuote() returns error? {
SimplePublicObjectInputForCreate payload = {
associations: [],
Expand All @@ -59,7 +63,10 @@ function testCreateNewQuote() returns error? {


// Test function for creating a batch of quotes
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testCreateNewBatchOfQuotes() returns error? {

SimplePublicObjectInputForCreate batchInput1 = {
Expand Down Expand Up @@ -93,7 +100,10 @@ function testCreateNewBatchOfQuotes() returns error? {


// Test for retrieving all quotes
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testGetAllQuotes() returns error? {

CollectionResponseSimplePublicObjectWithAssociationsForwardPaging response = check hubspotClient->/.get();
Expand All @@ -103,15 +113,21 @@ function testGetAllQuotes() returns error? {
}

// Test function for retrieving a quote
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testGetOneQuote() returns error? {
SimplePublicObjectWithAssociations response = check hubspotClient->/[testQuoteId].get();

test:assertEquals(response.id, testQuoteId, "Quote ID is missing.");
}

// Test function for retrieving a batch of quotes
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testGetBatchOfQuotes() returns error? {

SimplePublicObjectId batchInput0 = {
Expand All @@ -132,7 +148,10 @@ function testGetBatchOfQuotes() returns error? {


// Archive a quote by ID
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testArchiveOneQuote() returns error?{

http:Response response = check hubspotClient->/["0"].delete();
Expand All @@ -141,7 +160,10 @@ function testArchiveOneQuote() returns error?{
}

// Archive batch of quotes by ID
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testArchiveBatchOfQuoteById() returns error?{

SimplePublicObjectId id0 = {id:"0"};
Expand All @@ -159,7 +181,10 @@ function testArchiveBatchOfQuoteById() returns error?{


// Test function for updating a quote
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testUpdateOneQuote() returns error? {
SimplePublicObjectInput payload = {
properties: {
Expand All @@ -176,7 +201,10 @@ function testUpdateOneQuote() returns error? {
}

// Test function for updating a batch of quotes
@test:Config{}
@test:Config{
groups: ["live_tests"],
enable: enableLiveServerTest
}
function testUpdateBatchOfQuotes() returns error? {

SimplePublicObjectBatchInput batchInput3 = {
Expand Down

0 comments on commit 3dd6470

Please sign in to comment.