diff --git a/mockito-core/src/main/java/org/mockito/plugins/MockMaker.java b/mockito-core/src/main/java/org/mockito/plugins/MockMaker.java index c0b1cbcd2d..106350aa85 100644 --- a/mockito-core/src/main/java/org/mockito/plugins/MockMaker.java +++ b/mockito-core/src/main/java/org/mockito/plugins/MockMaker.java @@ -171,9 +171,8 @@ default StaticMockControl createStaticMock( + getClass().getSimpleName() + " does not support the creation of static mocks", "", - "Mockito's inline mock maker supports static mocks based on the Instrumentation API.", - "You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.", - "Note that Mockito's inline mock maker is not supported on Android.")); + "Ensure your MockMaker implementation supports this feature.", + "Note that static mocks maker is not supported on Android.")); } /** @@ -203,9 +202,8 @@ default ConstructionMockControl createConstructionMock( + getClass().getSimpleName() + " does not support the creation of construction mocks", "", - "Mockito's inline mock maker supports construction mocks based on the Instrumentation API.", - "You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.", - "Note that Mockito's inline mock maker is not supported on Android.")); + "Ensure your MockMaker implementation supports this feature.", + "Note that construction mocks maker is not supported on Android.")); } /** diff --git a/mockito-core/src/test/java/org/mockito/MockitoTest.java b/mockito-core/src/test/java/org/mockito/MockitoTest.java index 1671280d0c..619bbf2165 100644 --- a/mockito-core/src/test/java/org/mockito/MockitoTest.java +++ b/mockito-core/src/test/java/org/mockito/MockitoTest.java @@ -104,7 +104,7 @@ public void shouldValidateMockWhenCreatingInOrderObject() { @SuppressWarnings({"CheckReturnValue", "MockitoUsage"}) @Test - public void shouldGiveExplanationOnStaticMockingWithoutInlineMockMaker() { + public void shouldGiveExplanationOnStaticMockingMockMaker() { Assume.assumeThat(Plugins.getMockMaker(), not(instanceOf(InlineMockMaker.class))); assertThatThrownBy( @@ -114,14 +114,13 @@ public void shouldGiveExplanationOnStaticMockingWithoutInlineMockMaker() { .isInstanceOf(MockitoException.class) .hasMessageContainingAll( "The used MockMaker SubclassByteBuddyMockMaker does not support the creation of static mocks", - "Mockito's inline mock maker supports static mocks based on the Instrumentation API.", - "You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.", - "Note that Mockito's inline mock maker is not supported on Android."); + "Ensure your MockMaker implementation supports this feature.", + "Note that static mocks maker is not supported on Android."); } @SuppressWarnings({"CheckReturnValue", "MockitoUsage"}) @Test - public void shouldGiveExplanationOnConstructionMockingWithoutInlineMockMaker() { + public void shouldGiveExplanationOnConstructionMockingMockMaker() { Assume.assumeThat(Plugins.getMockMaker(), not(instanceOf(InlineMockMaker.class))); assertThatThrownBy( @@ -131,9 +130,8 @@ public void shouldGiveExplanationOnConstructionMockingWithoutInlineMockMaker() { .isInstanceOf(MockitoException.class) .hasMessageContainingAll( "The used MockMaker SubclassByteBuddyMockMaker does not support the creation of construction mocks", - "Mockito's inline mock maker supports construction mocks based on the Instrumentation API.", - "You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.", - "Note that Mockito's inline mock maker is not supported on Android."); + "Ensure your MockMaker implementation supports this feature.", + "Note that construction mocks maker is not supported on Android."); } @SuppressWarnings({"CheckReturnValue", "MockitoUsage"}) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy