Skip to content

Commit

Permalink
Move all test utils to test package
Browse files Browse the repository at this point in the history
COAND-852
  • Loading branch information
OscarSpruit committed Jun 13, 2024
1 parent 75130ef commit 2ffd5b9
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion example-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
versionCode version_code
versionName version_name

testInstrumentationRunner 'com.adyen.checkout.HiltTestRunner'
testInstrumentationRunner 'com.adyen.checkout.test.HiltTestRunner'
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout
package com.adyen.checkout.dropin

import com.adyen.checkout.robot.onDropIn
import com.adyen.checkout.robot.onMain
import com.adyen.checkout.rule.CheckoutTestRule
import com.adyen.checkout.test.robot.onDropIn
import com.adyen.checkout.test.robot.onMain
import com.adyen.checkout.test.rule.CheckoutTestRule
import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 19/4/2024.
*/

package com.adyen.checkout
package com.adyen.checkout.test

import android.app.Application
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.di
package com.adyen.checkout.test.di

import com.adyen.checkout.example.di.BaseUrl
import com.adyen.checkout.example.di.NetworkModule
import com.adyen.checkout.server.CheckoutMockWebServer
import com.adyen.checkout.test.server.CheckoutMockWebServer
import dagger.Module
import dagger.Provides
import dagger.hilt.components.SingletonComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.di
package com.adyen.checkout.test.di

import com.adyen.checkout.example.di.ConfigurationModule
import com.adyen.checkout.example.ui.configuration.ConfigurationProvider
import com.adyen.checkout.fake.FakeCheckoutConfigurationProvider
import com.adyen.checkout.test.fake.FakeCheckoutConfigurationProvider
import dagger.Binds
import dagger.Module
import dagger.hilt.components.SingletonComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.fake
package com.adyen.checkout.test.fake

import com.adyen.checkout.components.core.Amount
import com.adyen.checkout.components.core.CheckoutConfiguration
import com.adyen.checkout.core.Environment
import com.adyen.checkout.example.ui.configuration.ConfigurationProvider
import com.adyen.checkout.server.CheckoutMockWebServer
import com.adyen.checkout.test.server.CheckoutMockWebServer
import java.net.URL
import java.util.Locale
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.robot
package com.adyen.checkout.test.robot

import com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertDisplayed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.robot
package com.adyen.checkout.test.robot

import com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertDisplayed
import com.adevinta.android.barista.interaction.BaristaCheckboxInteractions.check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.robot
package com.adyen.checkout.test.robot

internal interface TestRobot {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.rule
package com.adyen.checkout.test.rule

import androidx.test.ext.junit.rules.ActivityScenarioRule
import com.adyen.checkout.example.ui.main.MainActivity
Expand All @@ -32,9 +32,9 @@ class CheckoutTestRule(
* - Rules after ActivityScenarioRule will be executed after the activity is launched
*/
RuleChain
.outerRule(hiltRule)
.around(MockServerRule())
.around(IdlingDispatcherRule())
.around(activityRule)
.apply(base, description)
.outerRule(hiltRule)
.around(MockServerRule())
.around(IdlingDispatcherRule())
.around(activityRule)
.apply(base, description)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.rule
package com.adyen.checkout.test.rule

import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.idling.CountingIdlingResource
import com.adyen.checkout.util.IdlingResourceDispatcher
import com.adyen.checkout.test.util.IdlingResourceDispatcher
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import org.junit.rules.TestRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.rule
package com.adyen.checkout.test.rule

import com.adyen.checkout.server.CheckoutMockWebServer
import com.adyen.checkout.test.server.CheckoutMockWebServer
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 5/6/2024.
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server
package com.adyen.checkout.test.server

import com.adyen.checkout.core.AdyenLogLevel
import com.adyen.checkout.core.internal.util.adyenLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 5/6/2024.
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server
package com.adyen.checkout.test.server

import com.adyen.checkout.core.AdyenLogLevel
import com.adyen.checkout.core.internal.util.adyenLog
import com.adyen.checkout.server.service.MockCheckoutService
import com.adyen.checkout.server.service.MockPublicKeyService
import com.adyen.checkout.server.service.MockSessionService
import com.adyen.checkout.test.server.service.MockCheckoutService
import com.adyen.checkout.test.server.service.MockPublicKeyService
import com.adyen.checkout.test.server.service.MockSessionService
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 5/6/2024.
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server.service
package com.adyen.checkout.test.server.service

import com.adyen.checkout.util.JsonFileReader
import com.adyen.checkout.test.util.JsonFileReader
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
import java.net.HttpURLConnection.HTTP_OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 5/6/2024.
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server.service
package com.adyen.checkout.test.server.service

import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server.service
package com.adyen.checkout.test.server.service

import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.server.service
package com.adyen.checkout.test.server.service

import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.util
package com.adyen.checkout.test.util

import androidx.test.espresso.idling.CountingIdlingResource
import kotlinx.coroutines.CoroutineDispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
*
* This file is open source and available under the MIT license. See the LICENSE file for more info.
*
* Created by oscars on 5/6/2024.
* Created by oscars on 6/6/2024.
*/

package com.adyen.checkout.util
package com.adyen.checkout.test.util

import androidx.test.platform.app.InstrumentationRegistry
import dagger.hilt.android.testing.HiltTestApplication
import java.io.InputStreamReader

internal object JsonFileReader {
Expand Down

0 comments on commit 2ffd5b9

Please sign in to comment.