Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

chore: Workaround for mockito #2860 #199

Merged
merged 5 commits into from Jan 26, 2023

Conversation

DaveTryon
Copy link
Collaborator

@DaveTryon DaveTryon commented Jan 13, 2023

Details

Due to mockito/mockito#2860, Dependbot has been unable to update to any version of mockito-inline since version 4.6.1. The failed attempts are as follows:

Version Failed PR
4.7.0 #169
4.8.0 #174
4.8.1 #176
4.9.0 #182
4.11.0 #198

In response to mockito/mockito#2860, a suggestion was made to use an ArgumentCaptor to capture the arguments and the RETURNS_SELF parameter for the builder. This PR makes that change, so we're now capturing arguments using the construct that is intended for that purpose. The mockito team has not committed to fixing this issue and may even be leaning toward not fixing it, since a more officially supported option exists to do what we're doing.

I've applied these changes locally to #198 and confirmed that the tests complete as expected.

Motivation

Allow newer versions of mockito

Context

Pull request checklist

  • [n/a] Addresses an existing issue:
  • [n/a] Added/updated relevant unit test(s)
  • Ran ./gradlew fastpass from AccessibilityInsightsForAndroidService
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:).

ExclusionStrategy exclusionStrategy;
JsonSerializer<Class> jsonSerializer;
@Captor ArgumentCaptor<FieldNamingStrategy> fieldNamingStrategy;
@Captor ArgumentCaptor<ExclusionStrategy> exclusiontStrategy;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo

Suggested change
@Captor ArgumentCaptor<ExclusionStrategy> exclusiontStrategy;
@Captor ArgumentCaptor<ExclusionStrategy> exclusionStrategy;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@dbjorge dbjorge left a comment

Choose a reason for hiding this comment

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

LGTM (modulo the typo)!

@DaveTryon DaveTryon merged commit 1ba9639 into microsoft:main Jan 26, 2023
@DaveTryon DaveTryon deleted the workaround-mockito-bug branch January 26, 2023 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants