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

Fixed unavailable mock classes #1066

Merged
merged 2 commits into from
Oct 5, 2022
Merged

Fixed unavailable mock classes #1066

merged 2 commits into from
Oct 5, 2022

Conversation

Damtev
Copy link
Member

@Damtev Damtev commented Oct 4, 2022

Description

After introducing nullability and single type parameter for Kotlin code generation, static mocks became broken - they were no longer considered as BuiltinClassId, which means they were tried to load with default class loader which is impossible due to classes from mock frameworks could not be load with it.

This request makes mock classes builtin again - it fixes the problem but is incorrect for Kotlin code generation. The proper support of it should be designed and implemented together with generics in code generation (as planned in #88).

Fixes #981.

Type of Change

Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Manual Scenario

Generating tests as mentioned in the issue.

Checklist:

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • All tests pass locally with my changes

@Damtev Damtev force-pushed the damtev/static_mocks_fix branch 3 times, most recently from 29e726f to 11820f0 Compare October 4, 2022 11:02
@Damtev Damtev force-pushed the damtev/static_mocks_fix branch from 11820f0 to 4c29331 Compare October 4, 2022 11:27
@Damtev Damtev merged commit 1260c8f into main Oct 5, 2022
@Damtev Damtev deleted the damtev/static_mocks_fix branch October 5, 2022 06:21
denis-fokin pushed a commit that referenced this pull request Oct 5, 2022
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
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.

Couldn't generate some tests: 2 occurrences of org.mockito.MockedStatic
3 participants