Skip to content

Conversation

@MihaiCristianCondrea
Copy link
Owner

Summary

  • replace Mockito-based banner view mocks with dedicated fake AdView and NativeAdBannerView implementations
  • exercise AdUtils.loadBanner behaviour via the fakes while keeping unsupported view handling unchanged

Testing

  • ./gradlew test (fails: SDK location not found in container)

https://chatgpt.com/codex/tasks/task_e_68c97643fcb8832dacae90ef95f718dd

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +91 to +96
private static final class FakeAdView extends AdView {
private boolean loadAdCalled;
private AdRequest lastRequest;

FakeAdView(Context context) {
super(context);

Choose a reason for hiding this comment

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

[P1] Avoid instantiating Android views in plain unit tests

The new FakeAdView/FakeNativeAdBannerView subclasses call the real AdView and NativeAdBannerView constructors. Those classes depend on Android UI and Google Play Services state (e.g., LayoutTransition, thread loopers) and cannot be instantiated in app/src/test JVM tests without Robolectric or instrumentation. The previous Mockito approach avoided touching framework code, but now the test suite will throw RuntimeException("Stub!") or similar before it can verify behavior. Consider keeping mocks or moving these tests to an Android-aware test environment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants