Skip to content

Commit

Permalink
⬆️ Add support for Android 14 (API 34)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-rasevych-criteo committed Jan 2, 2024
1 parent 19e9613 commit 00fb204
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 56 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ jobs:
fail-fast: false
matrix:
include:
- api: '29'
abi: 'x86'
tag: 'google_apis'

- api: '30'
abi: 'x86'
tag: 'playstore' # Explicitly need the PlayStore to fetch GAID
Expand All @@ -98,6 +94,10 @@ jobs:
- api: '33'
abi: 'x86_64'
tag: 'google_apis'

- api: '34'
abi: 'x86_64'
tag: 'google_apis'
steps:
- name: Checkout (latest)
uses: actions/checkout@v3
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:

- name: Upload XML reports for quality-tests
uses: actions/upload-artifact@v3
if: matrix.api == '33' # Only report latest supported version
if: matrix.api == '34' # Only report latest supported version
with:
name: android-quality-reports
path: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Next Version
- Add support of Android 14 (API level 34)

# Version 5.0.2
- Send SDK MRAID capability
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ buildscript {
plugins {
id("org.sonarqube") version "3.0"
id("io.github.gradle-nexus.publish-plugin")
id("com.github.ben-manes.versions") version "0.50.0"
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/AndroidModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ fun Project.androidLibModule(configure: AndroidModule.() -> Unit = {}) {

private fun Project.defaultAndroidModule() {
androidBase {
compileSdkVersion(33)
compileSdkVersion(34)

defaultConfig {
minSdkVersion(19)
targetSdkVersion(33)
targetSdkVersion(34)
versionCode = 1
versionName = sdkVersion()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ object Deps {
}

object Mockito {
private const val version = "3.9.0"
private const val version = "5.8.0"

const val Android = "org.mockito:mockito-android:$version"
const val Core = "org.mockito:mockito-core:$version"
const val Kotlin = "org.mockito.kotlin:mockito-kotlin:3.2.0"
const val Kotlin = "org.mockito.kotlin:mockito-kotlin:4.0.0"
}

object Square {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import org.mockito.kotlin.argumentCaptor
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever

class ExternalVideoPlayerTest {
Expand Down Expand Up @@ -86,7 +86,7 @@ class ExternalVideoPlayerTest {

externalVideoPlayer.play("https://criteo.com/cat_video.mp4", onErrorListener)

verifyZeroInteractions(onErrorListener)
verifyNoInteractions(onErrorListener)
val argumentCaptor = argumentCaptor<Intent>()
verify(context).startActivity(argumentCaptor.capture())
val intent = argumentCaptor.lastValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.mockito.junit.MockitoJUnit
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever

class AdChoiceOverlayNativeRendererTest {
Expand Down Expand Up @@ -118,6 +118,6 @@ class AdChoiceOverlayNativeRendererTest {

renderer.renderNativeView(helper, nativeView, nativeAd)

verifyZeroInteractions(delegate)
verifyNoInteractions(delegate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.spy
import org.mockito.kotlin.stub
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import java.net.URI

class ClickHelperTest {
Expand Down Expand Up @@ -61,7 +61,7 @@ class ClickHelperTest {
fun notifyUserClick_GivenNull_DoNothing() {
clickHelper.notifyUserClickAsync(null)

verifyZeroInteractions(runOnUiThreadExecutor)
verifyNoInteractions(runOnUiThreadExecutor)
}

@Test
Expand All @@ -78,7 +78,7 @@ class ClickHelperTest {
fun notifyUserIsLeavingApplication_GivenNull_DoNothing() {
clickHelper.notifyUserIsLeavingApplicationAsync(null)

verifyZeroInteractions(runOnUiThreadExecutor)
verifyNoInteractions(runOnUiThreadExecutor)
}

@Test
Expand All @@ -95,7 +95,7 @@ class ClickHelperTest {
fun notifyUserIsBackToApplication_GivenNull_DoNothing() {
clickHelper.notifyUserIsBackToApplicationAsync(null)

verifyZeroInteractions(runOnUiThreadExecutor)
verifyNoInteractions(runOnUiThreadExecutor)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.squareup.picasso.Picasso
import com.squareup.picasso.RequestCreator
import org.junit.Rule
import org.junit.Test
import org.mockito.Answers
import org.mockito.InjectMocks
import org.mockito.Mock
import org.mockito.Mockito.verify
Expand All @@ -41,7 +42,7 @@ class CriteoImageLoaderTest {
@Mock
private lateinit var picasso: Picasso

@Mock
@Mock(answer = Answers.CALLS_REAL_METHODS)
@Suppress("UnusedPrivateMember")
private lateinit var asyncResources: AsyncResources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever
import java.io.IOException
import javax.inject.Inject
Expand Down Expand Up @@ -348,8 +348,8 @@ class CriteoMraidControllerTest {
fun onPageFinishedGivenNonMraidAd_ShouldNotInitializeDefaultValues() {
givenNonMraidAdAndPageIsFinished()

verifyZeroInteractions(visibilityTracker)
verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(visibilityTracker)
verifyNoInteractions(mraidInteractor)
}

@Test
Expand All @@ -367,7 +367,7 @@ class CriteoMraidControllerTest {

criteoMraidController.onOpenFailed()

verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(mraidInteractor)
}

@Test
Expand Down Expand Up @@ -437,7 +437,7 @@ class CriteoMraidControllerTest {
criteoMraidController.onConfigurationChange(configuration)
}.doesNotThrowAnyException()

verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(mraidInteractor)
}

@Test
Expand All @@ -464,7 +464,7 @@ class CriteoMraidControllerTest {
criteoMraidController.onConfigurationChange(null)
}.doesNotThrowAnyException()

verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(mraidInteractor)
}

@Test
Expand Down Expand Up @@ -508,7 +508,7 @@ class CriteoMraidControllerTest {
criteoMraidController.onClosed()
}.doesNotThrowAnyException()

verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(mraidInteractor)
assertThat(criteoMraidController.currentState).isEqualTo(MraidState.LOADING)
}

Expand All @@ -524,7 +524,7 @@ class CriteoMraidControllerTest {
criteoMraidController.onPlayVideo("https://criteo.com/cat_video.mp4")

verify(externalVideoPlayer).play(eq("https://criteo.com/cat_video.mp4"), any())
verifyZeroInteractions(mraidInteractor)
verifyNoInteractions(mraidInteractor)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.mockito.Mock
import org.mockito.junit.MockitoJUnit
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions

class MraidExpandBannerMediatorTest {

Expand Down Expand Up @@ -129,7 +129,7 @@ class MraidExpandBannerMediatorTest {
mediator.requestClose()
mediator.requestOrientationChange(true, MraidOrientation.PORTRAIT)

verifyZeroInteractions(bannerListener)
verifyNoInteractions(bannerListener)
}

@Test
Expand All @@ -155,6 +155,6 @@ class MraidExpandBannerMediatorTest {
mediator.removeExpandedActivityListener()
mediator.notifyOnBackClicked()

verifyZeroInteractions(expandedActivityListener)
verifyNoInteractions(expandedActivityListener)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import org.mockito.kotlin.stub
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever
import java.io.IOException
import java.io.InterruptedIOException
Expand Down Expand Up @@ -385,7 +385,7 @@ class CsmBidLifecycleListenerTest {

listener.onBidConsumed(adUnit, slot)

verifyZeroInteractions(repository)
verifyNoInteractions(repository)
}

@Test
Expand Down Expand Up @@ -523,8 +523,8 @@ class CsmBidLifecycleListenerTest {
}

private fun verifyFeatureIsDeactivated() {
verifyZeroInteractions(repository)
verifyZeroInteractions(clock)
verifyZeroInteractions(sendingQueueProducer)
verifyNoInteractions(repository)
verifyNoInteractions(clock)
verifyNoInteractions(sendingQueueProducer)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import org.mockito.kotlin.never
import org.mockito.kotlin.stub
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever
import java.io.IOException

Expand Down Expand Up @@ -91,8 +91,8 @@ class MetricSendingQueueConsumerTest {

consumer.sendMetricBatch()

verifyZeroInteractions(queue)
verifyZeroInteractions(api)
verifyNoInteractions(queue)
verifyNoInteractions(api)
}

@Test
Expand All @@ -106,8 +106,8 @@ class MetricSendingQueueConsumerTest {

consumer.sendMetricBatch()

verifyZeroInteractions(queue)
verifyZeroInteractions(api)
verifyNoInteractions(queue)
verifyNoInteractions(api)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.spy
import org.mockito.kotlin.stub
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever
import org.mockito.stubbing.Answer
import java.io.File
Expand Down Expand Up @@ -194,7 +194,7 @@ class TapeSendingQueueTest(private val tapeImplementation: TapeImplementation) {
val metrics = queue.poll(0)

assertThat(metrics).isEmpty()
verifyZeroInteractions(tapeQueue)
verifyNoInteractions(tapeQueue)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.assertj.core.api.Assertions.assertThatCode
import org.junit.Before
import org.junit.Test
import org.mockito.kotlin.mock
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions

class DfpHeaderBiddingNoDfpTest {

Expand Down Expand Up @@ -60,6 +60,6 @@ via IntelliJ delegating test run to Gradle.

headerBidding.enrichBid(builder, AdUnitType.CRITEO_BANNER, mock())

verifyZeroInteractions(builder)
verifyNoInteractions(builder)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions

class HeaderBiddingTest {

Expand All @@ -51,9 +51,9 @@ class HeaderBiddingTest {

headerBidding.enrichBid(null, bid)

verifyZeroInteractions(bid)
verifyZeroInteractions(handler)
verifyZeroInteractions(integrationRegistry)
verifyNoInteractions(bid)
verifyNoInteractions(handler)
verifyNoInteractions(integrationRegistry)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.verifyZeroInteractions
import org.mockito.kotlin.verifyNoInteractions

class OtherAdServersHeaderBiddingTest {

Expand Down Expand Up @@ -65,7 +65,7 @@ class OtherAdServersHeaderBiddingTest {

headerBidding.cleanPreviousBid(builder)

verifyZeroInteractions(builder)
verifyNoInteractions(builder)
}

@Test
Expand Down Expand Up @@ -96,7 +96,7 @@ class OtherAdServersHeaderBiddingTest {

headerBidding.enrichBid(builder, CRITEO_BANNER, mock())

verifyZeroInteractions(builder)
verifyNoInteractions(builder)
}

@Test
Expand Down
Loading

0 comments on commit 00fb204

Please sign in to comment.