1 package org.robolectric.integrationtests.sdkcompat; 2 3 import static com.google.common.truth.Truth.assertThat; 4 5 import android.os.Build; 6 import org.junit.Test; 7 import org.junit.runner.RunWith; 8 import org.robolectric.RobolectricTestRunner; 9 import org.robolectric.RuntimeEnvironment; 10 import org.robolectric.Shadows; 11 12 /** 13 * Test class for Java's class resolve compatibility test. We must keep it with Java instead of 14 * converting it to Kotlin, because Kotlin has different behavior than Java without any error. 15 */ 16 @RunWith(RobolectricTestRunner.class) 17 public class JavaClassResolveCompatibilityTest { 18 @Test sdkIs29()19 public void sdkIs29() { 20 assertThat(Build.VERSION.SDK_INT).isEqualTo(Build.VERSION_CODES.Q); 21 } 22 23 @Test shadowOf()24 public void shadowOf() { 25 // https://github.com/robolectric/robolectric/issues/7095 26 assertThat(Shadows.shadowOf(RuntimeEnvironment.getApplication())).isNotNull(); 27 } 28 } 29