You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some improvements for the work from PR #1753 (#1809)
I had a half-finished review of PR #1753, then got a bad cold.
Now you merged it already, so I moved my review comments into this PR
here.
Most changes are just minor.
One notable change is, that I changed the order of cglib and mockito.
Even though cglib is deprecated, I think it should sill be selected
before mockito for consistency.
If you currently have cglib on the classpath but no byte buddy, it will
be used,
then with the new version suddenly mockito will be used which could
change the behavior.
It swapped the order, so that mockito is below, so that it is just used
as fallback for cases that couldn't be handled before.
What do you think?
Another notable change is, that I changed the toString of the mock maker
settings implementations that just returned the
mock maker id before and now return "mockito mock maker settings" or
"<ID> simple mock maker settings".
What do you think?
If you want to make final method mockable by default, you can select this mock maker as the preferred mock maker.
1108
-
It can't mock `native` methods, see Mockito for details.
1107
+
If you want to make final methods mockable by default, you can select this mock maker as the preferred mock maker.
1108
+
It can't mock native methods, see https://javadoc.io/doc/org.mockito/mockito-core/5.6.0/org/mockito/Mockito.html#Mocking_Final[the Mockito documentation] for details.
1109
1109
1110
-
CAUTION: If you try to mock a final method without a Mock Maker supporting it.
1111
-
It will silently fail, without honoring your specified interactions.
1110
+
CAUTION: If you try to mock a final method without a Mock Maker supporting it,
1111
+
it will silently fail, without honoring your specified interactions.
1112
1112
1113
-
You can configure the created mocks with the `org.mockito.MockSettings` during construction to use features provided by Mockito:
1113
+
You can configure the created mock objects using the interface `org.mockito.MockSettings` during the construction to use features provided by Mockito:
# This needs a classifier, but is has to be specified on the usage end https://melix.github.io/blog/2021/03/version-catalogs-faq.html#_why_can_t_i_use_excludes_or_classifiers
//We need to say Mockito it shall use the constructor otherwise it will not initialize fields of the spy, see org.mockito.Mockito.spy(java.lang.Class<T>), which does the same
0 commit comments