Skip to content

Commit 77fd50a

Browse files
committed
Kt format
1 parent de4c6a2 commit 77fd50a

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

firebase-functions/ktx/src/main/kotlin/com/google/firebase/functions/ktx/Functions.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,20 @@ class FirebaseFunctionsKtxRegistrar : ComponentRegistrar {
5050
}
5151

5252
/** Returns a reference to the Callable HTTPS trigger with the given name and call options. */
53-
fun FirebaseFunctions.getHttpsCallable(name: String, init: HttpsCallableOptions.Builder.() -> Unit) : HttpsCallableReference {
53+
fun FirebaseFunctions.getHttpsCallable(
54+
name: String,
55+
init: HttpsCallableOptions.Builder.() -> Unit
56+
): HttpsCallableReference {
5457
val builder = HttpsCallableOptions.Builder()
5558
builder.init()
5659
return getHttpsCallable(name, builder.build())
5760
}
5861

5962
/** Returns a reference to the Callable HTTPS trigger with the given URL and call options. */
60-
fun FirebaseFunctions.getHttpsCallableFromUrl(url: URL, init: HttpsCallableOptions.Builder.() -> Unit) : HttpsCallableReference {
63+
fun FirebaseFunctions.getHttpsCallableFromUrl(
64+
url: URL,
65+
init: HttpsCallableOptions.Builder.() -> Unit
66+
): HttpsCallableReference {
6167
val builder = HttpsCallableOptions.Builder()
6268
builder.init()
6369
return getHttpsCallableFromUrl(url, builder.build())

firebase-functions/ktx/src/test/kotlin/com/google/firebase/functions/TestVisibilityUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.functions;
15+
package com.google.firebase.functions
1616

1717
/**
1818
* Returns true if the {@link HttpsCallableReference} is configured to use FAC limited-use tokens.
1919
*/
20-
fun HttpsCallableReference.usesLimitedUseFacTokens() = options.getLimitedUseAppCheckTokens()
20+
fun HttpsCallableReference.usesLimitedUseFacTokens() = options.getLimitedUseAppCheckTokens()

firebase-functions/ktx/src/test/kotlin/com/google/firebase/functions/ktx/FunctionsTests.kt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ import com.google.firebase.ktx.Firebase
2424
import com.google.firebase.ktx.app
2525
import com.google.firebase.ktx.initialize
2626
import com.google.firebase.platforminfo.UserAgentPublisher
27+
import java.net.URL
2728
import org.junit.After
2829
import org.junit.Before
2930
import org.junit.Test
3031
import org.junit.runner.RunWith
3132
import org.robolectric.RobolectricTestRunner
32-
import java.lang.reflect.Field
33-
import java.net.URL
3433

3534
const val APP_ID = "APP_ID"
3635
const val API_KEY = "API_KEY"
@@ -114,17 +113,15 @@ class AppCheckLimitedUseTest : BaseTestCase() {
114113

115114
@Test
116115
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 }
120118
assertThat(callable.usesLimitedUseFacTokens()).isTrue()
121119
}
122120

123121
@Test
124122
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 }
128125
assertThat(callable.usesLimitedUseFacTokens()).isFalse()
129126
}
130127

@@ -136,17 +133,19 @@ class AppCheckLimitedUseTest : BaseTestCase() {
136133

137134
@Test
138135
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+
}
142140
assertThat(callable.usesLimitedUseFacTokens()).isTrue()
143141
}
144142

145143
@Test
146144
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+
}
150149
assertThat(callable.usesLimitedUseFacTokens()).isFalse()
151150
}
152-
}
151+
}

0 commit comments

Comments
 (0)