diff --git a/websub-ballerina/request_processor.bal b/websub-ballerina/request_processor.bal index 7f4edbde..f9186f91 100644 --- a/websub-ballerina/request_processor.bal +++ b/websub-ballerina/request_processor.bal @@ -139,7 +139,7 @@ isolated function processEventNotification(http:Caller caller, http:Request requ }; } _ => { - log:printError(string`Unrecognized content-type [${contentType}] found`); + log:printError(string `Unrecognized content-type [${contentType}] found`); } } diff --git a/websub-ballerina/sub_listener.bal b/websub-ballerina/sub_listener.bal index 537a3910..19282181 100644 --- a/websub-ballerina/sub_listener.bal +++ b/websub-ballerina/sub_listener.bal @@ -227,7 +227,7 @@ isolated function retrieveCallbackUrl(string? providedCallback, boolean appendSe if providedCallback is string { if appendServicePath { string completeSevicePath = retrieveCompleteServicePath(servicePath); - return string`${providedCallback}${completeSevicePath}`; + return string `${providedCallback}${completeSevicePath}`; } else { return providedCallback; } @@ -250,7 +250,7 @@ isolated function generateCallbackUrl(string[]|string servicePath, string host = config.host; string protocol = config.secureSocket is () ? "http" : "https"; string completeSevicePath = retrieveCompleteServicePath(servicePath); - return string`${protocol}://${host}:${port.toString()}${completeSevicePath}`; + return string `${protocol}://${host}:${port.toString()}${completeSevicePath}`; } # Retrieves the complete service path. @@ -322,8 +322,8 @@ isolated function initiateSubscription(SubscriberServiceConfiguration serviceCon SubscriptionChangeRequest request = retrieveSubscriptionRequest(topicUrl, callbackUrl, serviceConfig); var response = subscriberClientEp->subscribe(request); if response is SubscriptionChangeResponse { - string subscriptionSuccessMsg = string`Subscription Request successfully sent to Hub[${response.hub}], for Topic[${response.topic}], with Callback [${callbackUrl}]`; - log:printDebug(string`${subscriptionSuccessMsg}`); + string subscriptionSuccessMsg = string `Subscription Request successfully sent to Hub[${response.hub}], for Topic[${response.topic}], with Callback [${callbackUrl}]`; + log:printDebug(subscriptionSuccessMsg); } else { return response; } diff --git a/websub-ballerina/tests/content_verification_test.bal b/websub-ballerina/tests/content_verification_test.bal index b6d9fd8c..b233104e 100644 --- a/websub-ballerina/tests/content_verification_test.bal +++ b/websub-ballerina/tests/content_verification_test.bal @@ -58,7 +58,7 @@ function testOnEventNotificationSuccessForContentVerification() returns @tainted http:Request request = new; json payload = {"action":"publish","mode":"remote-hub"}; byte[] payloadHash = check retrievePayloadSignature(hashKey, payload); - request.setHeader("X-Hub-Signature", string`sha256=${payloadHash.toBase16()}`); + request.setHeader("X-Hub-Signature", string `sha256=${payloadHash.toBase16()}`); request.setPayload(payload); http:Response response = check contentVerificationClient->post("/", request); test:assertEquals(response.statusCode, 202); @@ -73,7 +73,7 @@ function testOnEventNotificationSuccessXmlForContentVerification() returns @tain http:Request request = new; xml payload = xml `publish`; byte[] payloadHash = check retrievePayloadSignature(hashKey, payload); - request.setHeader("X-Hub-Signature", string`sha256=${payloadHash.toBase16()}`); + request.setHeader("X-Hub-Signature", string `sha256=${payloadHash.toBase16()}`); request.setPayload(payload); http:Response response = check contentVerificationClient->post("/", request); test:assertEquals(response.statusCode, 202); @@ -88,7 +88,7 @@ function testOnEventNotificationSuccessForUrlEncodedForContentVerification() ret string payload = "param1=value1¶m2=value2"; byte[] payloadHash = check retrievePayloadSignature(hashKey, payload); request.setTextPayload(payload); - request.setHeader("X-Hub-Signature", string`sha256=${payloadHash.toBase16()}`); + request.setHeader("X-Hub-Signature", string `sha256=${payloadHash.toBase16()}`); check request.setContentType(mime:APPLICATION_FORM_URLENCODED); http:Response response = check contentVerificationClient->post("", request); test:assertEquals(response.statusCode, 202); diff --git a/websub-ballerina/tests/subscription_initiation_test.bal b/websub-ballerina/tests/subscription_initiation_test.bal index cdbbaf6a..a222c466 100644 --- a/websub-ballerina/tests/subscription_initiation_test.bal +++ b/websub-ballerina/tests/subscription_initiation_test.bal @@ -71,7 +71,7 @@ isolated function testSubscriptionInitiationFailureWithDiscoveryUrl() returns @t test:assertTrue(response is ResourceDiscoveryFailedError); if response is error { string errorDetails = response.message(); - string errorMsg = string`Subscription initiation failed due to: ${errorDetails}`; + string errorMsg = string `Subscription initiation failed due to: ${errorDetails}`; log:printError(errorMsg); } } @@ -85,7 +85,7 @@ isolated function testSubscriptionInitiationFailureWithHubAndTopic() returns @ta test:assertTrue(response is SubscriptionInitiationError); if response is error { string errorDetails = response.message(); - string errorMsg = string`Subscription initiation failed due to: ${errorDetails}`; + string errorMsg = string `Subscription initiation failed due to: ${errorDetails}`; log:printError(errorMsg); } } diff --git a/websub-ballerina/utils.bal b/websub-ballerina/utils.bal index 5e68f764..4fe0cc26 100644 --- a/websub-ballerina/utils.bal +++ b/websub-ballerina/utils.bal @@ -186,7 +186,7 @@ isolated function retrieveContentHash(string method, string key, string payload) return crypto:hmacSha512(contentPayload, keyArr); } _ => { - string errorMsg = string`Unrecognized hashning-method [${method}] found`; + string errorMsg = string `Unrecognized hashning-method [${method}] found`; log:printError(errorMsg); return error Error(errorMsg); } diff --git a/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_17/service.bal b/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_17/service.bal index d82bcaa9..3b16f4c0 100644 --- a/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_17/service.bal +++ b/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_17/service.bal @@ -26,14 +26,14 @@ service /subscriber on new websub:Listener(9090) { int hookId = check retrievedContent.hook_id; json sender = check retrievedContent.sender; int senderId = check sender.id; - io:println(string`PingEvent received for webhook [${hookId}]`); - io:println(string`Event sender [${senderId}]`); + io:println(string `PingEvent received for webhook [${hookId}]`); + io:println(string `Event sender [${senderId}]`); } else if (retrievedContent.ref is string) { json repository = check retrievedContent.repository; string repositoryName = check repository.name; string lastUpdatedTime = check repository.updated_at; - io:println(string`PushEvent received for [${repositoryName}]`); - io:println(string`Last updated at ${lastUpdatedTime}`); + io:println(string `PushEvent received for [${repositoryName}]`); + io:println(string `Last updated at ${lastUpdatedTime}`); } } else { io:println("Unrecognized content type, hence ignoring"); diff --git a/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_18/service.bal b/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_18/service.bal index d2e94eda..90fad311 100644 --- a/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_18/service.bal +++ b/websub-compiler-plugin-test/src/test/resources/ballerina_sources/sample_18/service.bal @@ -39,14 +39,14 @@ service /subscriber on new websub:Listener(9090) { int hookId = check retrievedContent.hook_id; json sender = check retrievedContent.sender; int senderId = check sender.id; - io:println(string`PingEvent received for webhook [${hookId}]`); - io:println(string`Event sender [${senderId}]`); + io:println(string `PingEvent received for webhook [${hookId}]`); + io:println(string `Event sender [${senderId}]`); } else if (retrievedContent.ref is string) { json repository = check retrievedContent.repository; string repositoryName = check repository.name; string lastUpdatedTime = check repository.updated_at; - io:println(string`PushEvent received for [${repositoryName}]`); - io:println(string`Last updated at ${lastUpdatedTime}`); + io:println(string `PushEvent received for [${repositoryName}]`); + io:println(string `Last updated at ${lastUpdatedTime}`); } } else { io:println("Unrecognized content type, hence ignoring");