From 650d87d6ca7583c59cbfbd51dbf3ce703e39af76 Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Tue, 3 Oct 2017 11:19:07 +0530 Subject: [PATCH] Fixing group management test failure --- .../test/java/org/wso2/carbon/device/mgt/core/TestUtils.java | 3 ++- .../mgt/core/service/GroupManagementProviderServiceTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestUtils.java index 29aad743c83..4b10c865c25 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestUtils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestUtils.java @@ -22,6 +22,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.GroupPaginationRequest; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; +import org.wso2.carbon.device.mgt.core.common.TestDataHolder; import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; @@ -108,7 +109,7 @@ public class TestUtils { public static List getDeviceIdentifiersList(){ DeviceIdentifier identifier = new DeviceIdentifier(); identifier.setId("12345"); - identifier.setType("Test"); + identifier.setType(TestDataHolder.TEST_DEVICE_TYPE); List list = new ArrayList<>(); list.add(identifier); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java index 994ef33e8e1..7ac1c9a2d8e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java @@ -27,6 +27,7 @@ import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.group.mgt.*; import org.wso2.carbon.device.mgt.core.TestUtils; import org.wso2.carbon.device.mgt.core.common.BaseDeviceManagementTest; +import org.wso2.carbon.device.mgt.core.common.TestDataHolder; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration; import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory; @@ -266,7 +267,7 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest public void getGroupsByDeviceIdentifier() throws GroupManagementException { DeviceIdentifier identifier = new DeviceIdentifier(); identifier.setId("12345"); - identifier.setType("Test"); + identifier.setType(TestDataHolder.TEST_DEVICE_TYPE); List groups = groupManagementProviderService.getGroups(identifier); Assert.assertNotNull(groups); }