-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ParameswaranSajeenthiran/main
Changes after Final Presentation Review.
- Loading branch information
Showing
9 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import ballerina/test; | ||
import ballerina/http; | ||
import ballerina/io; | ||
|
||
configurable string oauthKey = ?; | ||
|
||
# Completes a batch of callbacks | ||
# | ||
# + return - error? if an error occurs, null otherwise | ||
# | ||
@test:Config { | ||
groups: ["mock_tests"] | ||
} | ||
function testRespondBatch() returns error? { | ||
|
||
// BearerTokenConfig | ||
ConnectionConfig oauthConfig = { | ||
auth: { | ||
token: oauthKey | ||
} | ||
}; | ||
|
||
final Client hubspotAutomationOauth = check new Client(oauthConfig, "http://localhost:8080/mock"); | ||
|
||
BatchInputCallbackCompletionBatchRequest batchCallbackCompletionRequest = { | ||
inputs: [ | ||
{ | ||
callbackId: "1", | ||
outputFields: { | ||
"exampleField": "exampleValue" | ||
} | ||
} | ||
] | ||
}; | ||
http:Response response = check hubspotAutomationOauth->/callbacks/complete.post(batchCallbackCompletionRequest); | ||
|
||
io:print("Status Code "); | ||
io:println(response.statusCode); | ||
// assert response | ||
test:assertTrue(response.statusCode == 204, "Batch completion failed"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters