Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / library / locationprovider / src / test / java / com / android / location / provider / GeocoderParamsJvmTest.kt

GeocoderParamsJvmTest.kt24 lines · 855 BRaw
1package com.android.location.provider
2
3import android.location.GeocoderParams
4import kotlin.test.Test
5import kotlin.test.assertEquals
6import kotlin.test.assertFailsWith
7
8/**
9 * Plain-JVM (no Robolectric): the `android.location` package is loaded from
10 * the boot classpath under Robolectric, which shadows this module's stub.
11 * On a plain classpath the module class wins, so its stub contract is
12 * directly observable here.
13 */
14class GeocoderParamsJvmTest {
15
16 @Test
17 fun geocoderParamsAccessorsThrowStub() {
18 val ctor = GeocoderParams::class.java.getDeclaredConstructor()
19 ctor.isAccessible = true
20 val params = ctor.newInstance()
21 assertEquals("stub", assertFailsWith<RuntimeException> { params.locale }.message)
22 assertEquals("stub", assertFailsWith<RuntimeException> { params.clientPackage }.message)
23 }
24}