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

Use interceptor to mock any network request #6299

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tobiasKaminsky
Copy link
Member

Similar to nextcloud/android-library#454

This approach let us mock any network request when run an instrumented test (for now).
I am unsure about this concept:

  • it helps to mock any request, even requests to check if firewall is blocked
  • it tests client usage
  • it is heavily included in code
  • we can use other approaches to mock client entirely

What do you think?

Signed-off-by: tobiasKaminsky [email protected]

Testing

Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.

unit tests
instrumented tests
UI tests

  • Tests written, or not not needed

Signed-off-by: tobiasKaminsky <[email protected]>
Copy link
Collaborator

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 1
- Added 2
           

Complexity decreasing per file
==============================
+ src/main/java/com/owncloud/android/ui/asynctasks/NotificationExecuteActionTask.java  -1
         

See the complete overview on Codacy

public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boolean> {

private NotificationListAdapter.NotificationViewHolder holder;
private OwnCloudClient client;
private NextcloudClient client;
Copy link
Collaborator

Choose a reason for hiding this comment

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

public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boolean> {

private NotificationListAdapter.NotificationViewHolder holder;
private OwnCloudClient client;
private NextcloudClient client;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nextcloud-android-bot
Copy link
Collaborator

stable-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@nextcloud-android-bot
Copy link
Collaborator

@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14491.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

master-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@nextcloud-android-bot
Copy link
Collaborator

@nextcloud-android-bot
Copy link
Collaborator

Codacy

397

Lint

TypemasterPR
Warnings9595
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings64
Internationalization Warnings9
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings77
Security Warnings44
Dodgy code Warnings142
Total376

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings63
Internationalization Warnings9
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings75
Security Warnings44
Dodgy code Warnings142
Total373

Android-library is not set to master branch in build.gradle

SpotBugs increased!

@tobiasKaminsky tobiasKaminsky mentioned this pull request Jun 17, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants