diff --git a/cli/ballerina-cli/src/main/resources/create_cmd_templates/service/tests/service_test.bal b/cli/ballerina-cli/src/main/resources/create_cmd_templates/service/tests/service_test.bal index 0d85eb25166e..ba97e3bac6d0 100644 --- a/cli/ballerina-cli/src/main/resources/create_cmd_templates/service/tests/service_test.bal +++ b/cli/ballerina-cli/src/main/resources/create_cmd_templates/service/tests/service_test.bal @@ -5,32 +5,28 @@ import ballerina/test; http:Client testClient = check new ("http://localhost:9090"); // Before Suite Function - @test:BeforeSuite function beforeSuiteFunc() { io:println("I'm the before suite function!"); } // Test function - @test:Config {} function testServiceWithProperName() { - string|error response = testClient->get("/greeting/?name=John"); + string|error response = testClient->/greeting(name = "John"); test:assertEquals(response, "Hello, John"); } // Negative test function - @test:Config {} function testServiceWithEmptyName() returns error? { - http:Response response = check testClient->get("/greeting/"); + http:Response response = check testClient->/greeting; test:assertEquals(response.statusCode, 500); json errorPayload = check response.getJsonPayload(); test:assertEquals(errorPayload.message, "name should not be empty!"); } // After Suite Function - @test:AfterSuite function afterSuiteFunc() { io:println("I'm the after suite function!");