1 package org.robolectric.shadows; 2 3 import static org.assertj.core.api.Assertions.assertThat; 4 import static org.robolectric.RuntimeEnvironment.application; 5 6 import android.app.Notification; 7 import android.app.PendingIntent; 8 import android.content.Intent; 9 import org.junit.Test; 10 import org.junit.runner.RunWith; 11 import org.robolectric.RobolectricTestRunner; 12 13 @RunWith(RobolectricTestRunner.class) 14 public class ShadowNotificationTest { 15 16 @Test 17 public void setLatestEventInfo__shouldCaptureContentIntent() throws Exception { 18 PendingIntent pendingIntent = PendingIntent.getActivity(application, 0, new Intent(), 0); 19 Notification notification = new Notification(); 20 notification.setLatestEventInfo(application, "title", "content", pendingIntent); 21 assertThat(notification.contentIntent).isSameAs(pendingIntent); 22 } 23 } 24