Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/iron source mao rtb #527

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

jbsrc
Copy link

@jbsrc jbsrc commented Aug 25, 2024

No description provided.

@jbsrc jbsrc marked this pull request as ready for review August 29, 2024 15:18
Comment on lines +36 to +37
testImplementation "org.powermock:powermock-module-junit4:2.0.9"
testImplementation "org.powermock:powermock-api-mockito2:2.0.9"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these dependencies used somewhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted

@@ -21,13 +21,18 @@
import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: delete empty lines between imports for this and other files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted

@@ -243,8 +256,7 @@ public void loadRewardedAd(
AdError adError =
new AdError(
ERROR_SDK_NOT_INITIALIZED,
"Failed to load IronSource rewarded ad since IronSource SDK is not "
+ "initialized.",
"Failed to load IronSource rewarded ad since IronSource SDK is not " + "initialized.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is becoming one line, would it be better to remove the string concatenation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -349,8 +363,7 @@ public void loadBannerAd(
AdError loadError =
new AdError(
ERROR_SDK_NOT_INITIALIZED,
"Failed to load IronSource banner ad since IronSource SDK is not "
+ "initialized.",
"Failed to load IronSource banner ad since IronSource SDK is not " + "initialized.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,184 @@
// Copyright 2023 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to 2024

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,186 @@
// Copyright 2023 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of the comments on the IronSourceRtbInterstitialAd apply here as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 90 to 91
@Mock
private lateinit var initializationCompleteCallback: InitializationCompleteCallback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable. Also remove @mock annotation from imports

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

fun getSDKVersionInfo_validSDKVersionFor3Digits_returnsTheSameVersion() {
mockStatic(IronSourceUtils::class.java).use {
whenever(getSDKVersion()) doReturn "7.3.2"
@Before
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of these tests are not new, it is kind of hard to review given how GitHub shows the changes. My guess it is related to the extra indentation, do you think you can update to make GitHub correctly identify what is actually new code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, these settings are local. I changed the settings, but they are only applied for me. You can try changing them as well in the file changes tab --> settings

@Config(sdk = [28])
class IronSourceRtbInterstitialAdTest {

@Mock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid @Mock annotation and prefer kotlin mock method as the other test files. That way boilerplate code is avoided below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 142 to 147
val captor = argumentCaptor<AdError>()
verify(mediationAdLoadCallback).onFailure(captor.capture())
val capturedError = captor.firstValue
assertEquals(123, capturedError.code)
assertEquals("An error occurred", capturedError.message)
assertEquals("com.google.ads.mediation.ironsource", capturedError.domain)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the AdErrorMatcher to avoid all these boilerplate code. You can check an example of how to use it here. Same comment for other uses below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants