From cb0fb87b49328470bdbb48b962baf8bbb22c5ed0 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 11 Oct 2018 16:37:13 +0530 Subject: [PATCH] Fixing test failures and adding enhancements --- .../operation/mgt/dao/impl/ProfileOperationDAOImpl.java | 2 +- .../mgt/core/operation/OperationManagementTests.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index 64ffdf86f3..769537b47b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -174,7 +174,7 @@ public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { profileOperation = (ProfileOperation) obj; profileOperation.setStatus(status); operationList.add(profileOperation); - }; + } } } catch (IOException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java index dcfd63b995..3ca10bd90e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/operation/OperationManagementTests.java @@ -67,6 +67,7 @@ public class OperationManagementTests extends BaseDeviceManagementTest { private static final String POLICY_OPERATION_CODE = "POLICY-TEST"; private static final String CONFIG_OPERATION_CODE = "CONFIG-TEST"; private static final String PROFILE_OPERATION_CODE = "PROFILE-TEST"; + private static final String PROFILE_NOTIFICATION_CODE = "NOTIFICATION"; private static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; private static final int NO_OF_DEVICES = 5; private static final String ADMIN_USER = "admin"; @@ -205,8 +206,10 @@ public class OperationManagementTests extends BaseDeviceManagementTest { @Test(dependsOnMethods = "addConfigOperation") public void addProfileOperation() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - Activity activity = this.operationMgtService.addOperation(getOperation(new ProfileOperation(), - Operation.Type.PROFILE, PROFILE_OPERATION_CODE), + Operation opp = getOperation(new ProfileOperation(), + Operation.Type.PROFILE, PROFILE_NOTIFICATION_CODE); + opp.setPayLoad("{\"messageText\":\"xyz\",\"messageTitle\":\"abc\"}"); + Activity activity = this.operationMgtService.addOperation(opp , this.deviceIds); validateOperationResponse(activity, ActivityStatus.Status.PENDING); }