Search in sources :

Example 1 with PlaceInfoRequestParams

use of com.facebook.places.model.PlaceInfoRequestParams in project facebook-android-sdk by facebook.

the class PlaceManagerTest method testPlaceInfoRequest.

@Test
public void testPlaceInfoRequest() {
    PlaceInfoRequestParams.Builder builder = new PlaceInfoRequestParams.Builder();
    builder.setPlaceId("12345");
    builder.addField("field1");
    builder.addFields(new String[] { "field2", "field3" });
    PlaceInfoRequestParams params = builder.build();
    GraphRequest request = PlaceManager.newPlaceInfoRequest(params);
    assertEquals("12345", request.getGraphPath());
    assertEquals(HttpMethod.GET, request.getHttpMethod());
    Bundle requestParams = request.getParameters();
    assertEquals("field1,field3,field2", requestParams.get("fields"));
}
Also used : GraphRequest(com.facebook.GraphRequest) PlaceInfoRequestParams(com.facebook.places.model.PlaceInfoRequestParams) Bundle(android.os.Bundle) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Bundle (android.os.Bundle)1 GraphRequest (com.facebook.GraphRequest)1 PlaceInfoRequestParams (com.facebook.places.model.PlaceInfoRequestParams)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1