Package org.exoplatform.social.client.api.service.QueryParams

Examples of org.exoplatform.social.client.api.service.QueryParams.QueryParamOption


  @Test
  public void shouldGetQueryParam() {
    QueryParams queryParams = new QueryParamsImpl();
    //get QueryParamOption Null
    {
      QueryParamOption option = queryParams.get(QueryParams.NUMBER_OF_COMMENTS_PARAM);
      //
      assertThat(option, nullValue());
    }
    //get QueryParamOption Not Null
    {
      queryParams.clear();
      queryParams.append(QueryParams.IDENTITY_ID_PARAM.setValue("1234"));
     
      QueryParamOption option = queryParams.get(QueryParams.IDENTITY_ID_PARAM);
     
      assertThat(option, notNullValue());
           
      assertThat((String)option.getValue(), equalTo("1234"));
    }
   
    //get QueryParamOption Not Null with more existing
    {
      queryParams.clear();
      queryParams.append(QueryParams.IDENTITY_ID_PARAM.setValue("1234"))
                        .append(QueryParams.POSTER_IDENTITY_PARAM.setValue("1"))
                        .append(QueryParams.NUMBER_OF_COMMENTS_PARAM.setValue(10))
                        .append(QueryParams.NUMBER_OF_LIKES_PARAM.setValue(5))
                        .append(QueryParams.ACTIVITY_STREAM_PARAM)
                        .append(QueryParams.LIMIT_PARAM.setValue(20))
                        .append(QueryParams.SINCE_ID_PARAM.setValue("234567"))
                        .append(QueryParams.MAX_ID_PARAM.setValue("345678"));
     
      QueryParamOption option = queryParams.get(QueryParams.IDENTITY_ID_PARAM);
     
      assertThat(option, notNullValue());
           
      assertThat((String)option.getValue(), equalTo("1234"));
    }
  }
View Full Code Here

TOP

Related Classes of org.exoplatform.social.client.api.service.QueryParams.QueryParamOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.