mathewsreji commented on a change in pull request #4900:
URL: https://github.com/apache/camel/pull/4900#discussion_r565024025



##########
File path: 
components/camel-huaweicloud-smn/src/test/java/org/apache/camel/component/huaweicloud/smn/PublishTemplatedMessageTest.java
##########
@@ -0,0 +1,129 @@
+package org.apache.camel.component.huaweicloud.smn;
+
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.verification.LoggedRequest;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.huaweicloud.smn.models.ServiceKeys;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.exceptions.base.MockitoException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+
+public class PublishTemplatedMessageTest extends CamelTestSupport {
+
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(PublishTemplatedMessageTest.class.getName());
+    private static int wiremockServerPort = 8080;
+
+    TestConfiguration testConfiguration = new TestConfiguration();
+
+    WireMockServer wireMockServer;
+
+    @BindToRegistry("serviceKeys")
+    ServiceKeys serviceKeys
+            = new ServiceKeys(testConfiguration.getProperty("authKey"), 
testConfiguration.getProperty("secretKey"));
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+
+        // populating tag values. user has to adjust the map entries according 
to the structure of their respective templates
+        Map<String, String> tags = new HashMap<>();
+        tags.put("name", "reji");
+        tags.put("phone", "1234567890");
+
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:publish_templated_message")
+                        .setProperty("CamelHwCloudSmnSubject", constant("This 
is my subjectline"))
+                        .setProperty("CamelHwCloudSmnTopic", 
constant(testConfiguration.getProperty("topic")))
+                        .setProperty("CamelHwCloudSmnMessageTtl", constant(60))
+                        .setProperty("CamelHwCloudSmnTemplateTags", 
constant(tags))
+                        .setProperty("CamelHwCloudSmnTemplateName", 
constant("hello-template"))
+                        
//.to("hwcloud-smn:publishMessageService?serviceKeys=#serviceKeys&operation=publishAsTemplatedMessage"+"&projectId="+testConfiguration.getProperty("projectId")+"&region="+testConfiguration.getProperty("region")+"&proxyHost=localhost&proxyPort=3128&ignoreSslVerification=true")
+                        
.to("hwcloud-smn:publishMessageService?serviceKeys=#serviceKeys&operation=publishAsTemplatedMessage"
+                            + "&projectId=" + 
testConfiguration.getProperty("projectId") + "&region="
+                            + testConfiguration.getProperty("region") + 
"&ignoreSslVerification=true")
+                        .log("templated notification sent")
+                        .to("mock:publish_templated_message_result");
+            }
+        };
+    }
+
+    private void setupSimpleNotificationsUtilsMock() {
+        try {
+            Mockito.mockStatic(SimpleNotificationUtils.class);

Review comment:
       This is completely removed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to