Skip to content

fix(amazonq): mockito kotlin upgrade#6216

Draft
laileni-aws wants to merge 6 commits intoaws:mainfrom
laileni-aws:fix/mockito-kotlin-upgrade
Draft

fix(amazonq): mockito kotlin upgrade#6216
laileni-aws wants to merge 6 commits intoaws:mainfrom
laileni-aws:fix/mockito-kotlin-upgrade

Conversation

@laileni-aws
Copy link
Copy Markdown
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Update mockito from 5.12.0 to 5.20.0
- Update mockitoKotlin from 5.4.0 to 6.2.3
- Remove snapshot repository since we're using stable releases
- Update CodeWhispererTestBase.kt to use mockito-kotlin 6.x API syntax

This fixes failing CI tests caused by downgrading from 5.4.1-SNAPSHOT.
- Upgrade mockito-kotlin from 5.4.0 to 6.2.3
- Upgrade mockito-core from 5.12.0 to 5.20.0
- Remove snapshot repository from settings.gradle.kts
- Update deprecated API patterns in test files:
  - CodeWhispererTestBase.kt: doAnswer{}.wheneverBlocking -> stub{onBlocking{} doAnswer{}}
  - CodeWhispererServiceTest.kt: doCallRealMethod().wheneverBlocking -> stub{onBlocking{}.thenCallRealMethod()}
  - SetupAuthenticationDialogTest.kt (both 242-252 and 253+ versions): stub{whenever(it.method()).thenThrow/thenReturn} -> stub{on{method()} doThrow/doReturn}
- Use mock with CALLS_REAL_METHODS instead of spy in CodeWhispererTestBase
- This avoids invoking real suspend method during onBlocking stub setup
- Remove redundant .thenCallRealMethod() stubs in CodeWhispererServiceTest
@laileni-aws
Copy link
Copy Markdown
Contributor Author

/retryBuilds

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant