mirror of
https://github.com/hmalik144/Driver.git
synced 2026-01-31 02:41:46 +00:00
- mid commit
This commit is contained in:
@@ -16,7 +16,7 @@ import org.junit.After
|
|||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
|
||||||
|
|
||||||
open class BaseUiTest<T : BaseActivity<*,*>>(
|
open class BaseUiTest<T : BaseActivity<*, *>>(
|
||||||
private val activity: Class<T>
|
private val activity: Class<T>
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
package h_mal.appttude.com.driver
|
package h_mal.appttude.com.driver
|
||||||
|
|
||||||
import androidx.test.espresso.intent.rule.IntentsRule
|
|
||||||
import com.google.firebase.auth.FirebaseAuth
|
import com.google.firebase.auth.FirebaseAuth
|
||||||
import com.google.firebase.database.FirebaseDatabase
|
import com.google.firebase.database.FirebaseDatabase
|
||||||
import com.google.firebase.storage.FirebaseStorage
|
import com.google.firebase.storage.FirebaseStorage
|
||||||
import h_mal.appttude.com.driver.base.BaseActivity
|
import h_mal.appttude.com.driver.base.BaseActivity
|
||||||
import h_mal.appttude.com.driver.data.FirebaseAuthSource
|
import h_mal.appttude.com.driver.data.FirebaseAuthSource
|
||||||
import h_mal.appttude.com.driver.utils.GenericsHelper.getGenericClassAt
|
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import kotlinx.coroutines.tasks.await
|
import kotlinx.coroutines.tasks.await
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.BeforeClass
|
import org.junit.BeforeClass
|
||||||
import org.junit.Rule
|
|
||||||
|
|
||||||
open class FirebaseTest<T : BaseActivity<*, *>>(
|
open class FirebaseTest<T : BaseActivity<*, *>>(
|
||||||
activity: Class<T>,
|
activity: Class<T>,
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ package h_mal.appttude.com.driver
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import okhttp3.*
|
import okhttp3.Call
|
||||||
|
import okhttp3.Callback
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.resumeWithException
|
import kotlin.coroutines.resumeWithException
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import retrofit2.Response
|
|||||||
import retrofit2.Retrofit
|
import retrofit2.Retrofit
|
||||||
import retrofit2.converter.gson.GsonConverterFactory
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
import retrofit2.http.Body
|
import retrofit2.http.Body
|
||||||
import retrofit2.http.GET
|
|
||||||
import retrofit2.http.PUT
|
import retrofit2.http.PUT
|
||||||
import retrofit2.http.Query
|
|
||||||
|
|
||||||
interface FirebaseApi {
|
interface FirebaseApi {
|
||||||
|
|
||||||
@@ -26,8 +24,8 @@ interface FirebaseApi {
|
|||||||
suspend fun resetPassword(@Body request: ResetPasswordRequest): Response<ResetPasswordResponse>
|
suspend fun resetPassword(@Body request: ResetPasswordRequest): Response<ResetPasswordResponse>
|
||||||
|
|
||||||
// invoke method creating an invocation of the api call
|
// invoke method creating an invocation of the api call
|
||||||
companion object{
|
companion object {
|
||||||
operator fun invoke() : FirebaseApi {
|
operator fun invoke(): FirebaseApi {
|
||||||
val host = "10.0.2.2"
|
val host = "10.0.2.2"
|
||||||
val baseUrl = "http://$host:9099/identitytoolkit.googleapis.com/"
|
val baseUrl = "http://$host:9099/identitytoolkit.googleapis.com/"
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class NetworkConnectionInterceptor(
|
|||||||
private val applicationContext = context.applicationContext
|
private val applicationContext = context.applicationContext
|
||||||
|
|
||||||
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
||||||
if (!isInternetAvailable()){
|
if (!isInternetAvailable()) {
|
||||||
throw IOException("Make sure you have an active data connection")
|
throw IOException("Make sure you have an active data connection")
|
||||||
}
|
}
|
||||||
return chain.proceed(chain.request())
|
return chain.proceed(chain.request())
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package h_mal.appttude.com.driver.firebase.model
|
package h_mal.appttude.com.driver.firebase.model
|
||||||
|
|
||||||
data class OobCodeResponse(
|
data class OobCodeResponse(
|
||||||
val kind: String? = null,
|
val kind: String? = null,
|
||||||
val oobLink: String? = null,
|
val oobLink: String? = null,
|
||||||
val oobCode: String? = null,
|
val oobCode: String? = null,
|
||||||
val email: String? = null
|
val email: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package h_mal.appttude.com.driver.firebase.model
|
package h_mal.appttude.com.driver.firebase.model
|
||||||
|
|
||||||
data class ResetPasswordRequest(
|
data class ResetPasswordRequest(
|
||||||
val oldPassword: String? = null,
|
val oldPassword: String? = null,
|
||||||
val tenantId: String? = null,
|
val tenantId: String? = null,
|
||||||
val newPassword: String? = null,
|
val newPassword: String? = null,
|
||||||
val oobCode: String? = null,
|
val oobCode: String? = null,
|
||||||
val email: String? = null
|
val email: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package h_mal.appttude.com.driver.firebase.model
|
package h_mal.appttude.com.driver.firebase.model
|
||||||
|
|
||||||
data class ResetPasswordResponse(
|
data class ResetPasswordResponse(
|
||||||
val requestType: String? = null,
|
val requestType: String? = null,
|
||||||
val kind: String? = null,
|
val kind: String? = null,
|
||||||
val newEmail: String? = null,
|
val newEmail: String? = null,
|
||||||
val email: String? = null
|
val email: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package h_mal.appttude.com.driver.firebase.model
|
package h_mal.appttude.com.driver.firebase.model
|
||||||
|
|
||||||
data class SignUpRequest(
|
data class SignUpRequest(
|
||||||
val password: String? = null,
|
val password: String? = null,
|
||||||
val email: String? = null
|
val email: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user