Skip to content

Commit 7764992

Browse files
authored
Remove mention of mockito-inline from mockmaker exception (#3628)
`mockito-inline` is a discontinued artifact, since the inline mockmaker is now the default mockmaker in `mockito-core`. Fixes #3621
1 parent ee92ad4 commit 7764992

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

mockito-core/src/main/java/org/mockito/plugins/MockMaker.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ default <T> StaticMockControl<T> createStaticMock(
171171
+ getClass().getSimpleName()
172172
+ " does not support the creation of static mocks",
173173
"",
174-
"Mockito's inline mock maker supports static mocks based on the Instrumentation API.",
175-
"You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.",
176-
"Note that Mockito's inline mock maker is not supported on Android."));
174+
"Ensure your MockMaker implementation supports this feature.",
175+
"Note that static mocks maker is not supported on Android."));
177176
}
178177

179178
/**
@@ -203,9 +202,8 @@ default <T> ConstructionMockControl<T> createConstructionMock(
203202
+ getClass().getSimpleName()
204203
+ " does not support the creation of construction mocks",
205204
"",
206-
"Mockito's inline mock maker supports construction mocks based on the Instrumentation API.",
207-
"You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.",
208-
"Note that Mockito's inline mock maker is not supported on Android."));
205+
"Ensure your MockMaker implementation supports this feature.",
206+
"Note that construction mocks maker is not supported on Android."));
209207
}
210208

211209
/**

mockito-core/src/test/java/org/mockito/MockitoTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void shouldValidateMockWhenCreatingInOrderObject() {
104104

105105
@SuppressWarnings({"CheckReturnValue", "MockitoUsage"})
106106
@Test
107-
public void shouldGiveExplanationOnStaticMockingWithoutInlineMockMaker() {
107+
public void shouldGiveExplanationOnStaticMockingMockMaker() {
108108
Assume.assumeThat(Plugins.getMockMaker(), not(instanceOf(InlineMockMaker.class)));
109109

110110
assertThatThrownBy(
@@ -114,14 +114,13 @@ public void shouldGiveExplanationOnStaticMockingWithoutInlineMockMaker() {
114114
.isInstanceOf(MockitoException.class)
115115
.hasMessageContainingAll(
116116
"The used MockMaker SubclassByteBuddyMockMaker does not support the creation of static mocks",
117-
"Mockito's inline mock maker supports static mocks based on the Instrumentation API.",
118-
"You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.",
119-
"Note that Mockito's inline mock maker is not supported on Android.");
117+
"Ensure your MockMaker implementation supports this feature.",
118+
"Note that static mocks maker is not supported on Android.");
120119
}
121120

122121
@SuppressWarnings({"CheckReturnValue", "MockitoUsage"})
123122
@Test
124-
public void shouldGiveExplanationOnConstructionMockingWithoutInlineMockMaker() {
123+
public void shouldGiveExplanationOnConstructionMockingMockMaker() {
125124
Assume.assumeThat(Plugins.getMockMaker(), not(instanceOf(InlineMockMaker.class)));
126125

127126
assertThatThrownBy(
@@ -131,9 +130,8 @@ public void shouldGiveExplanationOnConstructionMockingWithoutInlineMockMaker() {
131130
.isInstanceOf(MockitoException.class)
132131
.hasMessageContainingAll(
133132
"The used MockMaker SubclassByteBuddyMockMaker does not support the creation of construction mocks",
134-
"Mockito's inline mock maker supports construction mocks based on the Instrumentation API.",
135-
"You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.",
136-
"Note that Mockito's inline mock maker is not supported on Android.");
133+
"Ensure your MockMaker implementation supports this feature.",
134+
"Note that construction mocks maker is not supported on Android.");
137135
}
138136

139137
@SuppressWarnings({"CheckReturnValue", "MockitoUsage"})

0 commit comments

Comments
 (0)