Skip to content

Commit

Permalink
Merge pull request #73 from iamport/feat/fix-deploy-failure
Browse files Browse the repository at this point in the history
jitpack 배포 에러 해결
  • Loading branch information
anymate98 authored Oct 13, 2023
2 parents e0b81b4 + de6a599 commit c160e33
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
4 changes: 4 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
4 changes: 3 additions & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ object Versions {
const val appcompat = "1.6.1"

const val mokito = "5.6.0"
const val mokito_inline = "5.2.0"
const val mokito_kotlin = "5.1.0"

const val junit = "4.13.1"
Expand Down Expand Up @@ -61,7 +62,7 @@ object Libs {

const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
const val mokito_core = "org.mockito:mockito-core:${Versions.mokito}"
const val mokito_inline = "org.mockito:mockito-inline:${Versions.mokito}"
const val mokito_inline = "org.mockito:mockito-inline:${Versions.mokito_inline}"
const val mokito_android = "org.mockito:mockito-android:${Versions.mokito}"
const val mokito_kotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mokito_kotlin}"

Expand Down Expand Up @@ -94,6 +95,7 @@ object Libs {

const val koin_core = "io.insert-koin:koin-core:${Versions.koin_version}"
const val koin_test = "io.insert-koin:koin-test:${Versions.koin_version}"
const val koin_test_junit4 = "io.insert-koin:koin-test-junit4:${Versions.koin_version}"

// Koin Java Compatibility
const val koin_android_compat = "io.insert-koin:koin-android-compat:${Versions.koin_version}"
Expand Down
1 change: 1 addition & 0 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ dependencies {

implementation Libs.koin_core
testImplementation Libs.koin_test
testImplementation Libs.koin_test_junit4
implementation Libs.koin_android
implementation Libs.koin_android_compat
implementation Libs.koin_android_compose
Expand Down
1 change: 1 addition & 0 deletions sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ dependencies {

implementation(Libs.koin_core)
testImplementation(Libs.koin_test)
testImplementation(Libs.koin_test_junit4)
implementation(Libs.koin_android)
implementation(Libs.koin_android_compat)
implementation(Libs.koin_android_compose)
Expand Down
38 changes: 18 additions & 20 deletions sdk/src/test/java/com/iamport/sdk/SdkUnitTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import com.orhanobut.logger.Logger.i
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import org.hamcrest.Matchers.`is`
import org.junit.Assert.assertThat
import org.junit.Assert.assertTrue
import org.junit.Test
import org.koin.test.inject
import kotlin.test.assertEquals
import kotlin.test.assertFalse


class SdkUnitTest : AbstractKoinTest() {
Expand All @@ -39,15 +40,12 @@ class SdkUnitTest : AbstractKoinTest() {
val method = repository.judgeStrategy.javaClass.getDeclaredMethod("findDefaultUserData", ArrayList::class.java)
method.isAccessible = true
i("userCode :: $userCode, default PG :: ${method.invoke(repository.judgeStrategy, it.value.data)}")
assertThat(true, `is`(true))
}
is ResultWrapper.GenericError -> {
i("${it.code} ${it.error}")
assertThat(false, `is`(true))
}
is ResultWrapper.NetworkError -> {
i(" ${it.error}")
assertThat(false, `is`(true))
}
}
}
Expand Down Expand Up @@ -100,11 +98,11 @@ class SdkUnitTest : AbstractKoinTest() {
}

val judge = repository.judgeStrategy.judge(chaiPayment)
assertThat(judge.first, `is`(JudgeStrategy.JudgeKinds.CHAI))
assertEquals(judge.first, JudgeStrategy.JudgeKinds.CHAI)
}

@Test
fun `remote 차이 prepare 테스트`() = runBlocking {
fun `remote 차이 prepare 테스트`(): Unit = runBlocking {

val chaiId = "15ef5fc6-43c8-4a27-b29f-e4a13897fc4c"
val chaiPayment = getDefaultPayment().run {
Expand All @@ -121,9 +119,9 @@ class SdkUnitTest : AbstractKoinTest() {
when (val resonse = ApiHelper.safeApiCall(Dispatchers.IO) { iamportApi.postPrepare(it) }) {
is ResultWrapper.Success -> {
i("${resonse.value}")
assertThat(true, `is`(true))
assertTrue(true)
}
else -> assertThat(false, `is`(true))
else -> assertTrue(false)
}
}
}
Expand All @@ -143,8 +141,8 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(false))
assertThat(second, `is`(CONST.ERR_PAYMENT_VALIDATOR_VBANK))
assertFalse(first)
assertEquals(second, CONST.ERR_PAYMENT_VALIDATOR_VBANK)
}
}

Expand All @@ -164,7 +162,7 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(true))
assertTrue(first)
}
}

Expand All @@ -183,8 +181,8 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(false))
assertThat(second, `is`(CONST.ERR_PAYMENT_VALIDATOR_PHONE))
assertTrue(first)
assertEquals(second, CONST.ERR_PAYMENT_VALIDATOR_PHONE)
}
}

Expand All @@ -204,7 +202,7 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(true))
assertTrue(first)
}
}

Expand All @@ -224,8 +222,8 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(false))
assertThat(second, `is`(CONST.ERR_PAYMENT_VALIDATOR_DANAL_VBANK))
assertFalse(first)
assertEquals(second, CONST.ERR_PAYMENT_VALIDATOR_DANAL_VBANK)
}
}

Expand All @@ -246,7 +244,7 @@ class SdkUnitTest : AbstractKoinTest() {

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(true))
assertTrue(first)
}
}

Expand Down Expand Up @@ -278,15 +276,15 @@ class SdkUnitTest : AbstractKoinTest() {
iamPortRequest = iamPortRequest?.copy(
pg = PG.paypal.makePgRawName(),
pay_method = PayMethod.card.name,
m_redirect_url = CONST.IAMPORT_PROD_URL,
// m_redirect_url = CONST.IAMPORT_PROD_URL,
)
)
}
i("$payment")

Payment.validator(payment).run {
i("$second")
assertThat(first, `is`(true))
assertTrue(first)
}
}
}
Expand Down

0 comments on commit c160e33

Please sign in to comment.