@@ -24,13 +24,12 @@ import com.google.firebase.ktx.Firebase
24
24
import com.google.firebase.ktx.app
25
25
import com.google.firebase.ktx.initialize
26
26
import com.google.firebase.platforminfo.UserAgentPublisher
27
+ import java.net.URL
27
28
import org.junit.After
28
29
import org.junit.Before
29
30
import org.junit.Test
30
31
import org.junit.runner.RunWith
31
32
import org.robolectric.RobolectricTestRunner
32
- import java.lang.reflect.Field
33
- import java.net.URL
34
33
35
34
const val APP_ID = " APP_ID"
36
35
const val API_KEY = " API_KEY"
@@ -114,17 +113,15 @@ class AppCheckLimitedUseTest : BaseTestCase() {
114
113
115
114
@Test
116
115
fun `FirebaseFunctions#getHttpsCallable should build callable with FAC settings (when true)` () {
117
- val callable = Firebase .functions.getHttpsCallable(" function" ) {
118
- limitedUseAppCheckTokens = true
119
- }
116
+ val callable =
117
+ Firebase .functions.getHttpsCallable(" function" ) { limitedUseAppCheckTokens = true }
120
118
assertThat(callable.usesLimitedUseFacTokens()).isTrue()
121
119
}
122
120
123
121
@Test
124
122
fun `FirebaseFunctions#getHttpsCallable should build callable with FAC settings (when false)` () {
125
- val callable = Firebase .functions.getHttpsCallable(" function" ) {
126
- limitedUseAppCheckTokens = false
127
- }
123
+ val callable =
124
+ Firebase .functions.getHttpsCallable(" function" ) { limitedUseAppCheckTokens = false }
128
125
assertThat(callable.usesLimitedUseFacTokens()).isFalse()
129
126
}
130
127
@@ -136,17 +133,19 @@ class AppCheckLimitedUseTest : BaseTestCase() {
136
133
137
134
@Test
138
135
fun `FirebaseFunctions#getHttpsCallableFromUrl callable with FAC settings (when true)` () {
139
- val callable = Firebase .functions.getHttpsCallableFromUrl(URL (" https://functions.test" )) {
140
- limitedUseAppCheckTokens = true
141
- }
136
+ val callable =
137
+ Firebase .functions.getHttpsCallableFromUrl(URL (" https://functions.test" )) {
138
+ limitedUseAppCheckTokens = true
139
+ }
142
140
assertThat(callable.usesLimitedUseFacTokens()).isTrue()
143
141
}
144
142
145
143
@Test
146
144
fun `FirebaseFunctions#getHttpsCallableFromUrl callable with FAC settings (when false)` () {
147
- val callable = Firebase .functions.getHttpsCallableFromUrl(URL (" https://functions.test" )) {
148
- limitedUseAppCheckTokens = false
149
- }
145
+ val callable =
146
+ Firebase .functions.getHttpsCallableFromUrl(URL (" https://functions.test" )) {
147
+ limitedUseAppCheckTokens = false
148
+ }
150
149
assertThat(callable.usesLimitedUseFacTokens()).isFalse()
151
150
}
152
- }
151
+ }
0 commit comments