@Test
public void validatePushParams_Invalid() {

    HashMap<String, Object> settingParams = new HashMap<String, Object>();
    //PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT not set
    try {
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_MISSING_USERNAME);
    }
    //PUSH_NOTIFICATIONS_FCM_SERVER_KEY missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_FCM_SERVER_KEY_MISSING);
    }
    //PUSH_NOTIFICATIONS_FCM_SERVER_KEY is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_FCM_SERVER_KEY_MISSING);
    }
    //PUSH_NOTIFICATIONS_FCM_SERVER_KEY is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_FCM_SERVER_KEY_MISSING);
    }
    //PUSH_NOTIFICATIONS_APPLICATION_NAME missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_APPLICATION_NAME_MISSING);
    }
    //PUSH_NOTIFICATIONS_APPLICATION_NAME is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_APPLICATION_NAME_MISSING);
    }
    //PUSH_NOTIFICATIONS_APPLICATION_NAME is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_APPLICATION_NAME_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_EMAIL missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_EMAIL_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_EMAIL is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_EMAIL_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_EMAIL is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_EMAIL_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_PASSWORD_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_PASSWORD_MISSING);
    }
    //PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_ACCOUNT_PASSWORD_MISSING);
    }
    //PUSH_NOTIFICATIONS_PUSH_DOMAIN missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_PUSH_DOMAIN_MISSING);
    }
    //PUSH_NOTIFICATIONS_PUSH_DOMAIN is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_PUSH_DOMAIN_MISSING);
    }
    //PUSH_NOTIFICATIONS_PUSH_DOMAIN is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_PUSH_DOMAIN_MISSING);
    }
    //PUSH_NOTIFICATIONS_HTTP_DOMAIN missing
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN, "pushdomain");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_RESTCOMM_DOMAIN_MISSING);
    }
    //PUSH_NOTIFICATIONS_HTTP_DOMAIN is null
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN, "pushdomain");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_HTTP_DOMAIN, null);
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_RESTCOMM_DOMAIN_MISSING);
    }
    //PUSH_NOTIFICATIONS_HTTP_DOMAIN is ""
    try {
        settingParams = new HashMap<String, Object>();
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT, true);
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY, "restcomm");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME, "test app");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL, "test@test.com");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD, "pass");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN, "pushdomain");
        settingParams.put(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_HTTP_DOMAIN, "");
        RCUtils.validateSettingsParms(settingParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_NOTIFICATION_RESTCOMM_DOMAIN_MISSING);
    }
}