Search in sources :

Example 1 with CurrentPlaceFeedbackRequestParams

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

the class PlaceManagerTest method testCurrentPlaceFeedbackRequest.

@Test
public void testCurrentPlaceFeedbackRequest() {
    CurrentPlaceFeedbackRequestParams.Builder builder = new CurrentPlaceFeedbackRequestParams.Builder();
    builder.setPlaceId("12345");
    builder.setTracking("trackingid");
    builder.setWasHere(true);
    CurrentPlaceFeedbackRequestParams params = builder.build();
    GraphRequest request = PlaceManager.newCurrentPlaceFeedbackRequest(params);
    assertEquals("current_place/feedback", request.getGraphPath());
    assertEquals(HttpMethod.POST, request.getHttpMethod());
    Bundle requestParams = request.getParameters();
    assertEquals("12345", requestParams.get("place_id"));
    assertEquals("trackingid", requestParams.get("tracking"));
    assertEquals(true, requestParams.get("was_here"));
}
Also used : GraphRequest(com.facebook.GraphRequest) Bundle(android.os.Bundle) CurrentPlaceFeedbackRequestParams(com.facebook.places.model.CurrentPlaceFeedbackRequestParams) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

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