Fixed build for tests

This commit is contained in:
Abdelilah El Aissaoui 2023-04-17 17:07:51 +02:00
parent c2b19a04d2
commit 7b7e5cbe82
No known key found for this signature in database
GPG Key ID: 7587FC860F594869

View File

@ -7,6 +7,7 @@ import com.jetpackduba.gitnuro.credentials.HttpCredentialsProvider
import com.jetpackduba.gitnuro.di.factories.HttpCredentialsFactory
import com.jetpackduba.gitnuro.git.remote_operations.CloneRepositoryUseCase
import com.jetpackduba.gitnuro.git.remote_operations.HandleTransportUseCase
import com.jetpackduba.gitnuro.managers.ShellManager
import com.jetpackduba.gitnuro.ssh.libssh.LibSshSession
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flowOn
@ -38,6 +39,7 @@ class BeforeRepoAllTestsExtension : BeforeAllCallback, AfterAllCallback {
context.root.getStore(GLOBAL).put("gitnuro_tests", this)
val credentialsStateManager = CredentialsStateManager()
val shellManager = ShellManager()
val ssh = Provider {
LibSshSession()
}
@ -47,7 +49,7 @@ class BeforeRepoAllTestsExtension : BeforeAllCallback, AfterAllCallback {
sessionManager = GSessionManager { GRemoteSession(ssh, credentialsStateManager) },
httpCredentialsProvider = object : HttpCredentialsFactory {
override fun create(git: Git?): HttpCredentialsProvider =
HttpCredentialsProvider(credentialsStateManager, git)
HttpCredentialsProvider(credentialsStateManager, shellManager, git)
},
)
)