Skip to content

Commit

Permalink
Merge pull request #550 from Vungle:7.4.3-release
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 718560682
  • Loading branch information
copybara-github committed Jan 22, 2025
2 parents b59837f + 7594a25 commit 64fc5f8
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 45 deletions.
3 changes: 3 additions & 0 deletions ThirdPartyAdapters/liftoffmonetize/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Liftoff Monetize Android Mediation Adapter Changelog

#### Next Version
- Verified compatibility with Vungle SDK 7.4.3.

#### Version 7.4.2.0
- Verified compatibility with Vungle SDK 7.4.2.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
// String property to store the artifact id.
stringArtifactId = "vungle"
// String property to store version name.
stringVersion = "7.4.2.0"
stringVersion = "7.4.3.0"
// String property to store group id.
stringGroupId = "com.google.ads.mediation"
// Jacoco version to generate code coverage data
Expand All @@ -25,7 +25,7 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
versionCode 7040200
versionCode 7040300
versionName stringVersion
buildConfigField("String", "ADAPTER_VERSION", "\"${stringVersion}\"")
multiDexEnabled true
Expand Down Expand Up @@ -119,9 +119,9 @@ task jacocoTestReport(type: JacocoReport,
}

dependencies {
implementation 'com.vungle:vungle-ads:7.4.2'
implementation 'com.vungle:vungle-ads:7.4.3'
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'com.google.android.gms:play-services-ads:23.5.0'
implementation 'com.google.android.gms:play-services-ads:23.6.0'

testImplementation "org.jacoco:org.jacoco.core:$jacocoVersion"
testImplementation 'junit:junit:4.13.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import com.google.android.gms.ads.AdError
import com.google.android.gms.ads.RequestConfiguration
import com.google.common.truth.Truth.assertThat
import com.vungle.ads.VungleError
import com.vungle.ads.VungleError.Companion.UNKNOWN_ERROR
import com.vungle.ads.VunglePrivacySettings
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -94,14 +94,18 @@ class VungleInitializerTest {
initializer.initialize("another_app_id", context, anotherInitializationListener)
val vungleError =
mock<VungleError> {
on { code } doReturn UNKNOWN_ERROR
on { code } doReturn SDKError.Reason.UNKNOWN_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK initialization failed."
}

initializer.onError(vungleError)

val expectedAdError =
AdError(UNKNOWN_ERROR, "Liftoff Monetize SDK initialization failed.", VUNGLE_SDK_ERROR_DOMAIN)
AdError(
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
verify(mockVungleInitializationListener)
.onInitializeError(argThat(AdErrorMatcher(expectedAdError)))
verify(anotherInitializationListener)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import com.vungle.ads.NativeAd.Companion.TOP_RIGHT
import com.vungle.ads.RewardedAd
import com.vungle.ads.VungleAdSize
import com.vungle.ads.VungleBannerView
import com.vungle.ads.VungleError
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -354,7 +354,7 @@ class VungleMediationAdapterTest {
fun loadRewardedAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -525,7 +525,7 @@ class VungleMediationAdapterTest {
fun loadNativeAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -652,7 +652,7 @@ class VungleMediationAdapterTest {
fun loadRewardedInterstitialAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -770,7 +770,7 @@ class VungleMediationAdapterTest {
fun loadAppOpenAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -898,7 +898,7 @@ class VungleMediationAdapterTest {
fun loadRtbRewardedAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -1027,7 +1027,7 @@ class VungleMediationAdapterTest {
fun loadRtbBannerAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -1158,7 +1158,7 @@ class VungleMediationAdapterTest {
fun loadRtbInterstitialAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -1338,7 +1338,7 @@ class VungleMediationAdapterTest {
fun loadRtbNativeAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -1470,7 +1470,7 @@ class VungleMediationAdapterTest {
fun loadRtbRewardedInterstitialAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down Expand Up @@ -1597,7 +1597,7 @@ class VungleMediationAdapterTest {
fun loadRtbAppOpenAd_onLiftoffSdkInitializationError_callsLoadFailure() {
val liftoffSdkInitError =
AdError(
VungleError.UNKNOWN_ERROR,
SDKError.Reason.UNKNOWN_ERROR_VALUE,
"Liftoff Monetize SDK initialization failed.",
VUNGLE_SDK_ERROR_DOMAIN,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.google.android.gms.ads.mediation.MediationRewardedAdCallback
import com.vungle.ads.AdConfig.Companion.LANDSCAPE
import com.vungle.ads.RewardedAd
import com.vungle.ads.VungleError
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -60,7 +61,7 @@ class VungleRewardedAdTest {
createMediationRewardedAdConfiguration(
context = context,
serverParameters = bundleOf(KEY_APP_ID to TEST_APP_ID, KEY_PLACEMENT_ID to TEST_PLACEMENT_ID),
mediationExtras = bundleOf(KEY_ORIENTATION to LANDSCAPE, KEY_USER_ID to TEST_USER_ID)
mediationExtras = bundleOf(KEY_ORIENTATION to LANDSCAPE, KEY_USER_ID to TEST_USER_ID),
)

@Before
Expand Down Expand Up @@ -89,7 +90,7 @@ class VungleRewardedAdTest {
adapter.loadRewardedAd(rewardedAdConfiguration, rewardedAdLoadCallback)
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_FAILED_TO_DOWNLOAD
on { code } doReturn SDKError.Reason.API_REQUEST_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK rewarded ad load failed."
}

Expand All @@ -99,7 +100,7 @@ class VungleRewardedAdTest {
AdError(
liftoffError.code,
liftoffError.errorMessage,
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN,
)
verify(rewardedAdLoadCallback).onFailure(argThat(AdErrorMatcher(expectedError)))
}
Expand Down Expand Up @@ -182,7 +183,7 @@ class VungleRewardedAdTest {
renderAdAndMockLoadSuccess()
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_UNABLE_TO_PLAY
on { code } doReturn SDKError.Reason.AD_NOT_LOADED_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK rewarded ad play failed."
}

Expand All @@ -192,7 +193,7 @@ class VungleRewardedAdTest {
AdError(
liftoffError.code,
liftoffError.errorMessage,
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN,
)
verify(rewardedAdCallback).onAdFailedToShow(argThat(AdErrorMatcher(expectedError)))
verifyNoMoreInteractions(rewardedAdCallback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.google.android.gms.ads.mediation.MediationAppOpenAdCallback
import com.vungle.ads.AdConfig.Companion.LANDSCAPE
import com.vungle.ads.InterstitialAd
import com.vungle.ads.VungleError
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -94,7 +95,7 @@ class VungleRtbAppOpenAdTest {
fun onAdFailedToLoad_callsLoadFailure() {
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_FAILED_TO_DOWNLOAD
on { code } doReturn SDKError.Reason.API_REQUEST_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK appOpen ad load failed."
}

Expand Down Expand Up @@ -187,7 +188,7 @@ class VungleRtbAppOpenAdTest {
renderAdAndMockLoadSuccess()
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_UNABLE_TO_PLAY
on { code } doReturn SDKError.Reason.AD_NOT_LOADED_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK ad play failed."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import com.google.common.truth.Truth.assertThat
import com.vungle.ads.BaseAd
import com.vungle.ads.VungleBannerView
import com.vungle.ads.VungleError
import com.vungle.ads.VungleError.Companion.AD_FAILED_TO_DOWNLOAD
import com.vungle.ads.VungleError.Companion.AD_UNABLE_TO_PLAY
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -113,7 +112,7 @@ class VungleRtbBannerAdTest {
fun onAdFailedToLoad_callsLoadFailure() {
val liftoffError =
mock<VungleError> {
on { code } doReturn AD_FAILED_TO_DOWNLOAD
on { code } doReturn SDKError.Reason.API_REQUEST_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK banner ad load failed."
}

Expand Down Expand Up @@ -178,7 +177,7 @@ class VungleRtbBannerAdTest {
fun onAdFailedToPlay_noCrash() {
val liftoffError =
mock<VungleError> {
on { code } doReturn AD_UNABLE_TO_PLAY
on { code } doReturn SDKError.Reason.AD_NOT_LOADED_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK banner ad play failed."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.google.android.gms.ads.mediation.MediationInterstitialAdCallback
import com.vungle.ads.AdConfig.Companion.LANDSCAPE
import com.vungle.ads.InterstitialAd
import com.vungle.ads.VungleError
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -67,10 +68,10 @@ class VungleRtbInterstitialAdTest {
bundleOf(KEY_APP_ID to TEST_APP_ID, KEY_PLACEMENT_ID to TEST_PLACEMENT_ID),
bidResponse = TEST_BID_RESPONSE,
watermark = TEST_WATERMARK,
mediationExtras = bundleOf(KEY_ORIENTATION to LANDSCAPE)
mediationExtras = bundleOf(KEY_ORIENTATION to LANDSCAPE),
),
interstitialAdLoadCallback,
vungleFactory
vungleFactory,
)

doAnswer { invocation ->
Expand All @@ -92,7 +93,7 @@ class VungleRtbInterstitialAdTest {
fun onAdFailedToLoad_callsLoadFailure() {
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_FAILED_TO_DOWNLOAD
on { code } doReturn SDKError.Reason.API_REQUEST_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK interstitial ad load failed."
}

Expand Down Expand Up @@ -168,7 +169,7 @@ class VungleRtbInterstitialAdTest {
renderAdAndMockLoadSuccess()
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_UNABLE_TO_PLAY
on { code } doReturn SDKError.Reason.AD_NOT_LOADED_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK interstitial ad play failed."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.google.android.gms.ads.mediation.UnifiedNativeAdMapper
import com.google.common.truth.Truth.assertThat
import com.vungle.ads.NativeAd
import com.vungle.ads.VungleError
import com.vungle.ads.internal.protos.Sdk.SDKError
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -82,7 +83,7 @@ class VungleRtbNativeAdTest {
bidResponse = TEST_BID_RESPONSE,
),
nativeAdLoadCallback,
vungleFactory
vungleFactory,
)

doAnswer { invocation ->
Expand Down Expand Up @@ -126,7 +127,7 @@ class VungleRtbNativeAdTest {
bundleOf(KEY_APP_ID to TEST_APP_ID, KEY_PLACEMENT_ID to TEST_PLACEMENT_ID),
),
nativeAdLoadCallback,
vungleFactory
vungleFactory,
)
Mockito.mockStatic(VungleInitializer::class.java).use {
whenever(VungleInitializer.getInstance()) doReturn vungleInitializer
Expand All @@ -142,7 +143,7 @@ class VungleRtbNativeAdTest {
fun onAdFailedToLoad_callsLoadFailure() {
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_FAILED_TO_DOWNLOAD
on { code } doReturn SDKError.Reason.API_REQUEST_ERROR_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK native ad load failed."
}

Expand All @@ -152,7 +153,7 @@ class VungleRtbNativeAdTest {
AdError(
liftoffError.code,
liftoffError.errorMessage,
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN
VungleMediationAdapter.VUNGLE_SDK_ERROR_DOMAIN,
)
verify(nativeAdLoadCallback).onFailure(argThat(AdErrorMatcher(expectedError)))
}
Expand All @@ -170,7 +171,7 @@ class VungleRtbNativeAdTest {
renderAdAndMockLoadSuccess()
val liftoffError =
mock<VungleError> {
on { code } doReturn VungleError.AD_UNABLE_TO_PLAY
on { code } doReturn SDKError.Reason.AD_NOT_LOADED_VALUE
on { errorMessage } doReturn "Liftoff Monetize SDK rewarded ad play failed."
}

Expand Down Expand Up @@ -257,7 +258,7 @@ class VungleRtbNativeAdTest {
eq(overlayView),
any(),
/* iconView = */ eq(null),
eq(listOf(iconView))
eq(listOf(iconView)),
)
}

Expand Down
Loading

0 comments on commit 64fc5f8

Please sign in to comment.