Skip to content

Commit

Permalink
refactor: update RiskSDK version to 1.0.4
Browse files Browse the repository at this point in the history
- this version downgrades cko logger to 1.0.1 in order to match compatibility with frames-android
  • Loading branch information
precious-ossai-cko committed Mar 7, 2024
1 parent c7c9015 commit 7798cab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import java.io.File
import java.io.FileInputStream
import java.util.Properties

//version constants for the Kotlin DSL dependencies
// version constants for the Kotlin DSL dependencies
object Versions {
private val versionProperties = loadVersionProperty()

Expand Down Expand Up @@ -36,7 +36,7 @@ object Versions {
const val moshi = "1.13.0"

// Risk SDK Dependencies
const val riskSdk = "1.0.3"
const val riskSdk = "1.0.4"

// Unit Testing Dependencies
const val junit5Jupiter = "5.8.0"
Expand Down
5 changes: 2 additions & 3 deletions checkout/src/main/java/com/checkout/logging/EventLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import android.content.Context
import androidx.annotation.VisibleForTesting
import com.checkout.base.model.Environment
import com.checkout.eventlogger.CheckoutEventLogger
import com.checkout.eventlogger.domain.model.MetadataKey
import com.checkout.eventlogger.METADATA_CORRELATION_ID
import com.checkout.eventlogger.domain.model.RemoteProcessorMetadata
import com.checkout.logging.model.LoggingEvent
import com.checkout.logging.utils.toLoggingEnvironment
import com.checkout.logging.utils.toLoggingName
import java.util.UUID

internal class EventLogger(private val logger: CheckoutEventLogger) : Logger<LoggingEvent> {

@VisibleForTesting
val sentLogs = hashSetOf<String>()

Expand All @@ -37,7 +36,7 @@ internal class EventLogger(private val logger: CheckoutEventLogger) : Logger<Log

override fun resetSession() {
val correlationId = UUID.randomUUID().toString()
logger.addMetadata(MetadataKey.correlationId, correlationId)
logger.addMetadata(METADATA_CORRELATION_ID, correlationId)
sentLogs.clear()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Context
import com.checkout.BuildConfig
import com.checkout.base.model.Environment
import com.checkout.eventlogger.CheckoutEventLogger
import com.checkout.eventlogger.METADATA_CORRELATION_ID
import com.checkout.eventlogger.domain.model.Event
import com.checkout.eventlogger.domain.model.MetadataKey
import com.checkout.eventlogger.domain.model.MonitoringLevel
import com.checkout.eventlogger.domain.model.RemoteProcessorMetadata
import com.checkout.logging.model.LoggingEvent
Expand Down Expand Up @@ -93,7 +93,7 @@ internal class EventLoggerTest {
eventLogger.resetSession()

// Then
verify { mockLogger.addMetadata(MetadataKey.correlationId, any()) }
verify { mockLogger.addMetadata(METADATA_CORRELATION_ID, any()) }
}

@Test
Expand All @@ -105,7 +105,7 @@ internal class EventLoggerTest {
eventLogger.resetSession()

// Then
verify { mockLogger.addMetadata(MetadataKey.correlationId, any()) }
verify { mockLogger.addMetadata(METADATA_CORRELATION_ID, any()) }
assertTrue((eventLogger as? EventLogger)?.sentLogs?.isEmpty() == true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class RiskSdkUseCaseTest {
coEvery { riskInstanceProvider.provide(context, PUBLIC_KEY, environment) } returns riskInstance
useCase =
RiskSdkUseCase(
environment = Environment.SANDBOX,
environment = environment,
context = context,
publicKey = PUBLIC_KEY,
riskInstanceProvider = riskInstanceProvider,
Expand Down

0 comments on commit 7798cab

Please sign in to comment.