@Test
public void validateConnectionParams_Invalid() {

    HashMap<String, Object> connectParams = new HashMap<String, Object>();
    //CONNECTION_PEER missing
    try {
        RCUtils.validateConnectionParms(connectParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_CONNECTION_MISSING_PEER);
    }
    //CONNECTION_PEER empty
    connectParams = new HashMap<String, Object>();
    try {
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "");
        RCUtils.validateConnectionParms(connectParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_CONNECTION_MISSING_PEER);
    }
    connectParams = new HashMap<String, Object>();
    //CONNECTION_VIDEO_ENABLED not passed
    try {
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm");
        RCUtils.validateConnectionParms(connectParams);
    } catch (RCException ex) {
       fail(ex.toString());
    }
    //CONNECTION_LOCAL_VIDEO == null
    connectParams = new HashMap<String, Object>();
    try {
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm");
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true);
        RCUtils.validateConnectionParms(connectParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_CONNECTION_VIDEO_CALL_VIEWS_MANDATORY);
    }
    //CONNECTION_REMOTE_VIDEO == null
    connectParams = new HashMap<String, Object>();
    try {
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm");
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true);
        connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context));
        RCUtils.validateConnectionParms(connectParams);
    } catch (RCException ex) {
        assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.ERROR_CONNECTION_VIDEO_CALL_VIEWS_MANDATORY);
    }
}