Ballerina -
function externalCall() returns string|error return error("Network failure");
Run tests:
int res1 = wait f1; string res2 = wait f2; ballerina
import ballerina/http; import ballerina/io; public function main() returns error? http:Client client = check new ("https://jsonplaceholder.typicode.com"); json response = check client->get("/posts/1"); io:println(response); string res2 = wait f2
[container.image] repository = "myorg/myapi" name = "myapi" tag = "v1.0" Ballerina includes a built-in test framework. json response = check client->
Call: