Skip to content

Conversation

MihaiCristianCondrea
Copy link
Owner

Summary

  • add DefaultHomeRemoteDataSource unit tests that capture the Volley request
  • verify successful responses filter out internal package names and deliver valid items
  • assert that network errors surface as empty lists for the callback

Testing

  • ./gradlew test (fails: Android SDK not configured in environment)

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

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 +33 to +35
RequestQueue requestQueue = mock(RequestQueue.class);
DefaultHomeRemoteDataSource dataSource = new DefaultHomeRemoteDataSource(requestQueue, "https://example.com");
makeSynchronous(dataSource);

Choose a reason for hiding this comment

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

[P1] Avoid instantiating Android Handler in local unit test

The new unit tests run from app/src/test, but DefaultHomeRemoteDataSource’s constructor immediately calls new Handler(Looper.getMainLooper()). On the plain JVM the Android stubs throw RuntimeException("Stub!") when either Handler or Looper is invoked, so the test will crash before any assertions run unless Robolectric or an instrumentation runner is used. Consider moving the test under androidTest or adding Robolectric/shadow configuration so the handler can be created.

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.

1 participant