1 package org.robolectric.shadows;
2 
3 import static android.os.Build.VERSION_CODES.KITKAT;
4 import static com.google.common.truth.Truth.assertThat;
5 import static org.robolectric.Shadows.shadowOf;
6 
7 import android.content.ContentProvider;
8 import androidx.test.ext.junit.runners.AndroidJUnit4;
9 import org.junit.Test;
10 import org.junit.runner.RunWith;
11 import org.robolectric.annotation.Config;
12 import org.robolectric.shadows.testing.TestContentProvider1;
13 
14 @RunWith(AndroidJUnit4.class)
15 public class ShadowContentProviderTest {
16   @Config(minSdk = KITKAT)
testSetCallingPackage()17   @Test public void testSetCallingPackage() throws Exception {
18     ContentProvider provider = new TestContentProvider1();
19     shadowOf(provider).setCallingPackage("calling-package");
20     assertThat(provider.getCallingPackage()).isEqualTo("calling-package");
21   }
22 }
23