-
Notifications
You must be signed in to change notification settings - Fork 197
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
base: main
Are you sure you want to change the base?
Release/iron source mao rtb #527
Conversation
init all ad format
testImplementation "org.powermock:powermock-module-junit4:2.0.9" | ||
testImplementation "org.powermock:powermock-api-mockito2:2.0.9" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; | |||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 2024
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Mock | ||
private lateinit var initializationCompleteCallback: InitializationCompleteCallback |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
unit tests: delete java annotations. style.
No description provided.