diff --git a/src/main/java/org/mockito/Mockito.java b/src/main/java/org/mockito/Mockito.java index 8336c81bfa..98c46e1c80 100644 --- a/src/main/java/org/mockito/Mockito.java +++ b/src/main/java/org/mockito/Mockito.java @@ -162,7 +162,8 @@ * } * * - * Be aware that this artifact may be abolished when the inline mock making feature is integrated into the default mock maker. + * Be aware that starting from 5.0.0 the inline mock maker became the default mock maker and this + * artifact may be abolished in future versions. * *

* For more information about inline mock making, see section 39. @@ -1329,12 +1330,11 @@ * *

39. Mocking final types, enums and final methods (Since 2.1.0)

* - * Mockito now offers an {@link Incubating}, optional support for mocking final classes and methods. + * Mockito now offers support for mocking final classes and methods by default. * This is a fantastic improvement that demonstrates Mockito's everlasting quest for improving testing experience. * Our ambition is that Mockito "just works" with final classes and methods. * Previously they were considered unmockable, preventing the user from mocking. - * We already started discussing how to make this feature enabled by default. - * Currently, the feature is still optional as we wait for more feedback from the community. + * Since 5.0.0, this feature is enabled by default. * *

* This alternative mock maker which uses @@ -1342,10 +1342,10 @@ * a mock. This way, it becomes possible to mock final types and methods. * *

- * This mock maker is turned off by default because it is based on completely different mocking mechanism - * that requires more feedback from the community. It can be activated explicitly by the mockito extension mechanism, - * just create in the classpath a file /mockito-extensions/org.mockito.plugins.MockMaker - * containing the value mock-maker-inline. + * In versions preceding 5.0.0, this mock maker is turned off by default because it is based on + * completely different mocking mechanism that required more feedback from the community. It can be activated + * explicitly by the mockito extension mechanism, just create in the classpath a file + * /mockito-extensions/org.mockito.plugins.MockMaker containing the value mock-maker-inline. * *

* As a convenience, the Mockito team provides an artifact where this mock maker is preconfigured. Instead of using the @@ -1634,7 +1634,6 @@ * Specifying mock maker for individual mocks (Since 4.8.0) * * You may encounter situations where you want to use a different mock maker for a specific test only. - * For example, you might want to migrate to the inline mock maker, but a few test do not work right away. * In such case, you can (temporarily) use {@link MockSettings#mockMaker(String)} and {@link Mock#mockMaker()} * to specify the mock maker for a specific mock which is causing the problem. * diff --git a/src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyMockMaker.java b/src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyMockMaker.java index f6cba2946b..9a836bbbb1 100644 --- a/src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyMockMaker.java +++ b/src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyMockMaker.java @@ -16,8 +16,7 @@ * ByteBuddy MockMaker. * * This class will serve as the programmatic entry point to all mockito internal MockMakers. - * Currently the default and only mock maker is the subclassing engine, but with enough feedback we can later - * promote the inlining engine for features like final class/methods mocks. + * Currently the default mock maker is the inlining engine. * * The programmatic API could look like {@code mock(Final.class, withSettings().finalClasses())}. */