1 package com.android.managedprovisioning.contracts
2 
3 import android.os.Build
4 import com.android.onboarding.contracts.NodeId
5 import com.android.onboarding.contracts.OnboardingNodeId
6 import com.android.onboarding.contracts.testing.NodeAwareIntentSerializerTest
7 import com.android.onboarding.contracts.testing.TEST_NODE_ID
8 import dagger.hilt.android.testing.BindValue
9 import dagger.hilt.android.testing.HiltAndroidRule
10 import dagger.hilt.android.testing.HiltAndroidTest
11 import dagger.hilt.android.testing.HiltTestApplication
12 import org.junit.Before
13 import org.junit.Rule
14 import org.junit.runner.RunWith
15 import org.robolectric.RobolectricTestRunner
16 import org.robolectric.annotation.Config
17 import javax.inject.Inject
18 
19 @RunWith(RobolectricTestRunner::class)
20 @Config(minSdk = Build.VERSION_CODES.VANILLA_ICE_CREAM, application = HiltTestApplication::class)
21 @HiltAndroidTest
22 class DownloadRoleHolderContractTest : NodeAwareIntentSerializerTest<DownloadRoleHolderArguments>() {
23     @get:Rule
24     val hiltRule = HiltAndroidRule(this)
25 
26     @BindValue
27     @OnboardingNodeId
28     @Suppress("Unused")
29     val nodeId: NodeId = TEST_NODE_ID
30 
31     @Inject
32     override lateinit var target: DownloadRoleHolderContract
<lambda>null33     override val data = requireNotNull(aProvisioningParams.roleHolderDownloadInfo).let {
34         DownloadRoleHolderArguments(
35                 suwArguments = aSuwArguments,
36                 provisioningParams = aProvisioningParams,
37                 location = it.location,
38                 checksum = Checksum.SignatureChecksum(it.signatureChecksum),
39                 cookieHeader = it.cookieHeader,
40                 minVersion = it.minVersion,
41         )
42     }
43 
44     @Before
setUpnull45     fun setUp() {
46         hiltRule.inject()
47     }
48 }
49