From 48c89b06b941b937cc4853b86f9531254cb9153e Mon Sep 17 00:00:00 2001 From: Pahansith Date: Wed, 14 Aug 2019 08:52:49 +0530 Subject: [PATCH 1/2] Add test case for newly added method on DeviceManagementProviderService --- .../mocks/DeviceManagementProviderServiceMock.java | 8 ++++++++ .../mocks/DeviceManagementProviderServiceMock.java | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 40bbfbb03..3ab0fa16a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.mocks; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; @@ -617,4 +618,11 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv public boolean updateEnrollment(String owner, List deviceIdentifiers) { return false; } + + @Override + public DeviceConfiguration getDevicesConfiguration(Map map) + throws DeviceManagementException, DeviceNotFoundException, InvalidArgumentException, + UnauthorizedDeviceAccessException { + return null; + } } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 40bbfbb03..3ab0fa16a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.services.android.mocks; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; @@ -617,4 +618,11 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv public boolean updateEnrollment(String owner, List deviceIdentifiers) { return false; } + + @Override + public DeviceConfiguration getDevicesConfiguration(Map map) + throws DeviceManagementException, DeviceNotFoundException, InvalidArgumentException, + UnauthorizedDeviceAccessException { + return null; + } } From bc38a4a6d6bccace2e4891204b6be5b2a9956f53 Mon Sep 17 00:00:00 2001 From: Pahansith Date: Tue, 27 Aug 2019 23:37:22 +0530 Subject: [PATCH 2/2] Fix test fail due to not overriding getDeviceConfiguration method --- .../android/mocks/DeviceManagementProviderServiceMock.java | 7 ++++--- .../android/mocks/DeviceManagementProviderServiceMock.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 3ab0fa16a..414f232b6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -19,6 +19,7 @@ package org.wso2.carbon.mdm.services.android.mocks; import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.configuration.mgt.AmbiguousConfigurationException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -620,9 +621,9 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv } @Override - public DeviceConfiguration getDevicesConfiguration(Map map) - throws DeviceManagementException, DeviceNotFoundException, InvalidArgumentException, - UnauthorizedDeviceAccessException { + public DeviceConfiguration getDeviceConfiguration(Map propertyMap) + throws DeviceManagementException, DeviceNotFoundException, UnauthorizedDeviceAccessException, + AmbiguousConfigurationException{ return null; } } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 3ab0fa16a..414f232b6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -19,6 +19,7 @@ package org.wso2.carbon.mdm.services.android.mocks; import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.configuration.mgt.AmbiguousConfigurationException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -620,9 +621,9 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv } @Override - public DeviceConfiguration getDevicesConfiguration(Map map) - throws DeviceManagementException, DeviceNotFoundException, InvalidArgumentException, - UnauthorizedDeviceAccessException { + public DeviceConfiguration getDeviceConfiguration(Map propertyMap) + throws DeviceManagementException, DeviceNotFoundException, UnauthorizedDeviceAccessException, + AmbiguousConfigurationException{ return null; } }