diff --git a/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/JDBCConsumer.java b/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/JDBCConsumer.java index 4fa2c09100..0b65591dec 100644 --- a/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/JDBCConsumer.java +++ b/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/JDBCConsumer.java @@ -64,4 +64,9 @@ public void setId(int i) { public String getId() { return null; } + + @Override + public boolean reInitialize() { + return false; + } } diff --git a/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/jpa/JPAConsumer.java b/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/jpa/JPAConsumer.java index 8e069c1b7d..1fcb63b8db 100644 --- a/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/jpa/JPAConsumer.java +++ b/components/business-adaptors/org.wso2.micro.integrator.business.messaging.hl7/src/main/java/org/wso2/micro.integrator/business/messaging/hl7/store/jpa/JPAConsumer.java @@ -64,4 +64,9 @@ public boolean reInitialize() { public String getId() { return null; } + + @Override + public boolean reInitialize() { + return false; + } } \ No newline at end of file diff --git a/integration/mediation-tests/tests-other/src/test/java/org/wso2/carbon/esb/synapse/expression/test/SynapseExpressionTestCase.java b/integration/mediation-tests/tests-other/src/test/java/org/wso2/carbon/esb/synapse/expression/test/SynapseExpressionTestCase.java new file mode 100644 index 0000000000..fe11aa73dc --- /dev/null +++ b/integration/mediation-tests/tests-other/src/test/java/org/wso2/carbon/esb/synapse/expression/test/SynapseExpressionTestCase.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.esb.synapse.expression.test; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.esb.integration.common.utils.CarbonLogReader; +import org.wso2.esb.integration.common.utils.ESBIntegrationTest; +import org.wso2.esb.integration.common.utils.clients.SimpleHttpClient; + +import java.util.HashMap; +import java.util.Map; + +import static org.testng.Assert.assertTrue; + +/** + * Testcase to test Synapse Expressions to fetch registry, registry property, path query and function params + */ +public class SynapseExpressionTestCase extends ESBIntegrationTest { + + private CarbonLogReader carbonLogReader; + private static final String targetApiName = "synapseexpression_api"; + + @BeforeClass(alwaysRun = true) + public void uploadSynapseConfig() throws Exception { + super.init(); + verifyAPIExistence(targetApiName); + carbonLogReader = new CarbonLogReader(); + carbonLogReader.start(); + } + + @Test(groups = "wso2.esb", description = "Testcase to test Synapse Expressions to fetch registry, registry " + + "property, path query and function params") + public void testSynapseExpressions() throws Exception { + String contentType = "application/json"; + String payload = "{\"hello\": \"world\"}"; + String url = getApiInvocationURL(targetApiName); + url = url + "/abc/hello/pqr?qparam1=zxc&qparam2=uio"; + + Map headers = new HashMap<>(1); + headers.put("Content-Type", contentType); + + SimpleHttpClient httpClient = new SimpleHttpClient(); + httpClient.doPost(url, headers, payload, contentType); + + carbonLogReader.checkForLog("pathParam1 = abc, pathParam2 = pqr, queryParam1 = zxc, queryParam2 = uio," + + " regProp = hello world, regValue = John", DEFAULT_TIMEOUT); + String logs = carbonLogReader.getLogs(); + assertTrue(logs.contains("pathParam1 = abc")); + assertTrue(logs.contains("pathParam2 = pqr")); + assertTrue(logs.contains("queryParam1 = zxc")); + assertTrue(logs.contains("queryParam2 = uio")); + assertTrue(logs.contains("regProp = hello world")); + assertTrue(logs.contains("regValue = John")); + assertTrue(logs.contains("funcParam1 = hello")); + assertTrue(logs.contains("funcParam2 = world")); + carbonLogReader.stop(); + } + + @AfterClass(alwaysRun = true) + public void destroy() throws Exception { + super.cleanup(); + } +} diff --git a/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/repository/deployment/server/carbonapps/SynapseExpressionTestCase_1.0.0.car b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/repository/deployment/server/carbonapps/SynapseExpressionTestCase_1.0.0.car new file mode 100644 index 0000000000..bca27bca96 Binary files /dev/null and b/integration/mediation-tests/tests-other/src/test/resources/artifacts/ESB/server/repository/deployment/server/carbonapps/SynapseExpressionTestCase_1.0.0.car differ diff --git a/integration/mediation-tests/tests-other/src/test/resources/testng.xml b/integration/mediation-tests/tests-other/src/test/resources/testng.xml index fb04855801..f1fddd84eb 100644 --- a/integration/mediation-tests/tests-other/src/test/resources/testng.xml +++ b/integration/mediation-tests/tests-other/src/test/resources/testng.xml @@ -61,6 +61,12 @@ + + + + + + diff --git a/pom.xml b/pom.xml index b56428be11..7944442c58 100644 --- a/pom.xml +++ b/pom.xml @@ -1606,7 +1606,7 @@ 2.4.0-b180830.0359 2.3.0 2.3.1 - 4.0.0-wso2v143 + 4.0.0-wso2v144 [4.0.0, 4.0.1) 4.7.215 1.1.3