Sha256: 69a55bcb3181a7f5de325a697e70c907401dd742ae5e2d0ffc00f2cd3ff175ec
Contents?: true
Size: 969 Bytes
Versions: 11
Compression:
Stored size: 969 Bytes
Contents
import ballerina/test; import ballerina/io; import ballerina/http; boolean serviceStarted; function startService() { serviceStarted = test:startServices("hello-world-service"); } @test:Config { before: "startService", after: "stopService" } function testFunc() { // Invoking the main function endpoint http:Client httpEndpoint { url: "http://localhost:9090" }; // Chck whether the server is started test:assertTrue(serviceStarted, msg = "Unable to start the service"); string response1 = "Hello, World!"; // Send a GET request to the specified endpoint var response = httpEndpoint->get("/hello/sayHello"); match response { http:Response resp => { var res = check resp.getTextPayload(); test:assertEquals(res, response1); } error err => test:assertFail(msg = "Failed to call the endpoint:"); } } function stopService() { test:stopServices("hello-world-service"); }
Version data entries
11 entries across 11 versions & 1 rubygems