From 981244f2c69af89895cc10cb3475323e6c2d43a9 Mon Sep 17 00:00:00 2001 From: Ace Date: Tue, 3 Oct 2017 15:33:33 +0530 Subject: [PATCH] Adding corrections to unit test code --- .../DeviceManagementProviderServiceTest.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java index 94487a07747..1975a56828a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java @@ -478,18 +478,10 @@ public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTes } } - @Test - public void testSendRegistrationEmailNoMetaInfo() { - try { - deviceMgtService.sendRegistrationEmail(null); - Assert.assertTrue(false); - } catch (ConfigurationManagementException e) { - Assert.assertTrue(false, "Error in sending registration email : Configration " + - "related error" + e.getMessage()); - } catch (DeviceManagementException e) { - Assert.assertTrue(true, "Device Management Exception thrown when meta info for " + - "email sending is not available" + e.getMessage()); - } + @Test(expectedExceptions = DeviceManagementException.class) + public void testSendRegistrationEmailNoMetaInfo() throws ConfigurationManagementException, DeviceManagementException { + deviceMgtService.sendRegistrationEmail(null); + Assert.assertTrue(false); } @Test