forked from GitLiveApp/firebase-java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFirebaseAppTest.kt
More file actions
41 lines (36 loc) · 1.38 KB
/
FirebaseAppTest.kt
File metadata and controls
41 lines (36 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import android.app.Application
import com.google.firebase.Firebase
import com.google.firebase.FirebaseOptions
import com.google.firebase.FirebasePlatform
import com.google.firebase.initialize
import org.junit.Test
class FirebaseAppTest : FirebaseTest() {
@Test
fun `initialize firebase`() {
FirebasePlatform.initializeFirebasePlatform(
object : FirebasePlatform() {
val storage = mutableMapOf<String, String>()
override fun store(
key: String,
value: String
) = storage.set(key, value)
override fun retrieve(key: String) = storage[key]
override fun clear(key: String) {
storage.remove(key)
}
override fun log(msg: String) = println(msg)
}
)
val options =
FirebaseOptions
.Builder()
.setProjectId("fir-java-sdk")
.setApplicationId("1:341458593155:web:bf8e1aa37efe01f32d42b6")
.setApiKey("AIzaSyCvVHjTJHyeStnzIE7J9LLtHqWk6reGM08")
.setDatabaseUrl("https://fir-java-sdk-default-rtdb.firebaseio.com")
.setStorageBucket("fir-java-sdk.appspot.com")
.setGcmSenderId("341458593155")
.build()
Firebase.initialize(Application(), options)
}
}