@Test(description = "Tests the push notification scheduling for devices")
public void testPushNotificationScheduler()
        throws DeviceManagementException, OperationManagementException, SQLException,
        OperationManagementDAOException {

    try {
        log.info("Attempting to execute push notification task scheduler");
        Mockito.doReturn(new TestNotificationStrategy()).when(this.deviceMgtProviderService)
                .getNotificationStrategyByDeviceType(Mockito.anyString());
        Mockito.doReturn(new org.wso2.carbon.device.mgt.common.operation.mgt.Operation())
                .when(this.deviceMgtProviderService).getOperation(Mockito.anyString(), Mockito.anyInt());
        this.pushNotificationSchedulerTask.run();
        OperationManagementDAOFactory.openConnection();
        Map<Integer, List<OperationMapping>> operationMappingsTenantMap = operationDAO
                .getOperationMappingsByStatus(Operation.Status.PENDING, Operation.PushNotificationStatus.SCHEDULED,
                        DeviceConfigurationManager.getInstance().getDeviceManagementConfig()
                                .getPushNotificationConfiguration().getSchedulerBatchSize());
        Assert.assertEquals(operationMappingsTenantMap.size(), 0);
        log.info("Push notification task execution complete.");
    } finally {
        OperationManagementDAOFactory.closeConnection();
    }
}