From 2e5579fdc228af9d5605e305e582016201c74816 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 7 Jul 2023 11:16:53 +0530 Subject: [PATCH] fixed operation template unit tests --- .../template/mock/BaseOperationTemplatePluginTest.java | 1 + .../test/resources/carbon-home/dbscripts/insert-subtypes.sql | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/resources/carbon-home/dbscripts/insert-subtypes.sql diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java index c563311602..58c7e8b65f 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java @@ -144,6 +144,7 @@ public abstract class BaseOperationTemplatePluginTest { conn = ConnectionManagerUtils.getDBConnection(); stmt = conn.createStatement(); stmt.executeUpdate("RUNSCRIPT FROM './src/test/resources/carbon-home/dbscripts/dm-db-h2.sql'"); + stmt.executeUpdate("RUNSCRIPT FROM './src/test/resources/carbon-home/dbscripts/insert-subtypes.sql'"); } finally { TestUtils.cleanupResources(conn, stmt, null); } diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/resources/carbon-home/dbscripts/insert-subtypes.sql b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/resources/carbon-home/dbscripts/insert-subtypes.sql new file mode 100644 index 0000000000..ffa001a086 --- /dev/null +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/resources/carbon-home/dbscripts/insert-subtypes.sql @@ -0,0 +1,3 @@ +INSERT INTO DM_DEVICE_SUB_TYPE (SUB_TYPE_ID, TENANT_ID, DEVICE_TYPE, SUB_TYPE_NAME, TYPE_DEFINITION) VALUES +(3,-1234,'METER','TestSubType','{"make": "TestSubType", "model": "ATx-Mega SIM800", "subTypeId": 3, "hasSMSSupport": true, "hasICMPSupport": true, "socketServerPort": 8071}'), +(4,-1234,'METER','TestSubType','{"make": "TestSubType", "model": "ATx-Mega SIM800", "subTypeId": 4, "hasSMSSupport": true, "hasICMPSupport": true, "socketServerPort": 8071}'); \ No newline at end of file