@Test
public void testGetPendingIntentForGeofence() {

    // when pendingIntent type is geofence
    PendingIntent actual = PendingIntentFactory.getPendingIntent(application,
            PendingIntentFactory.PENDING_INTENT_GEOFENCE, PendingIntent.FLAG_UPDATE_CURRENT);
    ShadowPendingIntent shadowPendingIntent = Shadows.shadowOf(actual);
    assertTrue(shadowPendingIntent.isBroadcastIntent());
    assertEquals(1001001, shadowPendingIntent.getRequestCode());
    assertEquals(PendingIntent.FLAG_UPDATE_CURRENT, shadowPendingIntent.getFlags());
    ComponentName actualComponentName = new ComponentName(application, CTGeofenceReceiver.class);
    assertEquals(CTGeofenceConstants.ACTION_GEOFENCE_RECEIVER,
            shadowPendingIntent.getSavedIntent().getAction());
    assertEquals(actualComponentName, shadowPendingIntent.getSavedIntent().getComponent());
}