Skip to content

Commit

Permalink
feature(bank-sdk): Skonto + RA. Tests fix
Browse files Browse the repository at this point in the history
PP-722
  • Loading branch information
ndubkov-distcotech committed Aug 26, 2024
1 parent 6cbb757 commit 40f37f6
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import net.gini.android.bank.api.requests.ErrorEvent
import net.gini.android.bank.api.requests.ResolvePaymentBody
import net.gini.android.bank.api.response.ConfigurationResponse
import net.gini.android.bank.api.response.ResolvePaymentResponse
import net.gini.android.core.api.response.DocumentLayoutResponse
import net.gini.android.core.api.response.DocumentPageResponse
import net.gini.android.core.api.response.PaymentRequestResponse
import net.gini.android.core.api.response.PaymentResponse
import okhttp3.RequestBody
Expand Down Expand Up @@ -169,6 +171,20 @@ class BankApiDocumentRemoteSourceTest {
return Response.success(null)
}

override suspend fun getDocumentLayout(
bearer: Map<String, String>,
documentId: String
): Response<DocumentLayoutResponse> {
return Response.success(null)
}

override suspend fun getDocumentPages(
bearer: Map<String, String>,
documentId: String
): Response<List<DocumentPageResponse>> {
return Response.success(null)
}

override suspend fun getPaymentRequests(bearer: Map<String, String>): Response<List<PaymentRequestResponse>> {
// Is tested in core api library
return Response.success(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ object GiniBank {
callback: (CreateCaptureFlowFragmentForIntentResult) -> Unit
): CancellationToken {
check(giniCapture != null) { "Capture feature is not configured. Call setCaptureConfiguration before creating the CaptureFlowFragment." }
BankSdkIsolatedKoinContext.init(context)
return giniCapture!!.createDocumentForImportedFiles(
intent,
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object BankSdkIsolatedKoinContext {
val koin: Koin by lazy {
koinApplication {
val ctx = context
check(ctx != null) {
check(ctx != null) {
"Koin needs to be initialized first. " +
"Call BankSdkIsolatedKoinContext.init(context)!"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import net.gini.android.core.api.response.DocumentLayoutResponse
import net.gini.android.core.api.response.DocumentPageResponse
import net.gini.android.core.api.response.PaymentRequestResponse
import net.gini.android.core.api.test.DocumentRemoteSourceForTests
import net.gini.android.core.api.test.MockGiniApiType
Expand Down Expand Up @@ -234,5 +236,21 @@ class DocumentRemoteSourceTest {
bearerAuthHeader = bearer["Authorization"]
return Response.success(null)
}

override suspend fun getDocumentLayout(
bearer: Map<String, String>,
documentId: String
): Response<DocumentLayoutResponse> {
bearerAuthHeader = bearer["Authorization"]
return Response.success(null)
}

override suspend fun getDocumentPages(
bearer: Map<String, String>,
documentId: String
): Response<List<DocumentPageResponse>> {
bearerAuthHeader = bearer["Authorization"]
return Response.success(null)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import net.gini.android.core.api.response.DocumentLayoutResponse
import net.gini.android.core.api.response.DocumentPageResponse
import net.gini.android.core.api.response.PaymentRequestResponse
import net.gini.android.core.api.response.PaymentResponse
import net.gini.android.health.api.models.PaymentRequestInput
Expand Down Expand Up @@ -225,5 +227,19 @@ class HealthApiDocumentRemoteSourceTest {
return Response.success(null)
}

override suspend fun getDocumentLayout(
bearer: Map<String, String>,
documentId: String
): Response<DocumentLayoutResponse> {
return Response.success(null)
}

override suspend fun getDocumentPages(
bearer: Map<String, String>,
documentId: String
): Response<List<DocumentPageResponse>> {
return Response.success(null)
}

}
}

0 comments on commit 40f37f6

Please sign in to comment.