8000 Remove all Incubating annotations (#2437) · mockito/mockito@7032574 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7032574

Browse files
authored
Remove all Incubating annotations (#2437)
For all of these APIs, we have been shipping them for at least 1 major release. We consider all of these APIs part of the public API contract now and therefore we should mark them as such. This PR removes all usages of the annotation. If we were to later remove an API, it will first have to be deprecated and then removed in a subsequent major release. However, we have no plans to do so with any of these APIs.
1 parent c8dbc10 commit 7032574

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+0
-177
lines changed

src/main/java/org/mockito/AdditionalAnswers.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ public static <T> Answer<T> returnsElementsOf(Collection<?> elements) {
330330
*
331331
* @since 2.8.44
332332
*/
333-
@Incubating
334333
public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer) {
335334
return (Answer<T>) new AnswersWithDelay(sleepyTime, (Answer<Object>) answer);
336335
}
@@ -344,7 +343,6 @@ public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer)
344343
* @return the answer object to use
345344
* @since 2.1.0
346345
*/
347-
@Incubating
348346
public static <T, A> Answer<T> answer(Answer1<T, A> answer) {
349347
return toAnswer(answer);
350348
}
@@ -357,7 +355,6 @@ public static <T, A> Answer<T> answer(Answer1<T, A> answer) {
357355
* @return the answer object to use
358356
* @since 2.1.0
359357
*/
360-
@Incubating
361358
public static <A> Answer<Void> answerVoid(VoidAnswer1<A> answer) {
362359
return toAnswer(answer);
363360
}
@@ -372,7 +369,6 @@ public static <A> Answer<Void> answerVoid(VoidAnswer1<A> answer) {
372369
* @return the answer object to use
373370
* @since 2.1.0
374371
*/
375-
@Incubating
376372
public static <T, A, B> Answer<T> answer(Answer2<T, A, B> answer) {
377373
return toAnswer(answer);
378374
}
@@ -386,7 +382,6 @@ public static <T, A, B> Answer<T> answer(Answer2<T, A, B> answer) {
386382
* @return the answer object to use
387383
* @since 2.1.0
388384
*/
389-
@Incubating
390385
public static <A, B> Answer<Void> answerVoid(VoidAnswer2<A, B> answer) {
391386
return toAnswer(answer);
392387
}
@@ -402,7 +397,6 @@ public static <A, B> Answer<Void> answerVoid(VoidAnswer2<A, B> answer) {
402397
* @return the answer object to use
403398
* @since 2.1.0
404399
*/
405-
@Incubating
406400
public static <T, A, B, C> Answer<T> answer(Answer3<T, A, B, C> answer) {
407401
return toAnswer(answer);
408402
}
@@ -417,7 +411,6 @@ public static <T, A, B, C> Answer<T> answer(Answer3<T, A, B, C> answer) {
417411
* @return the answer object to use
418412
* @since 2.1.0
419413
*/
420-
@Incubating
421414
public static <A, B, C> Answer<Void> answerVoid(VoidAnswer3<A, B, C> answer) {
422415
return toAnswer(answer);
423416
}
@@ -434,7 +427,6 @@ public static <A, B, C> Answer<Void> answerVoid(VoidAnswer3<A, B, C> answer) {
434427
* @return the answer object to use
435428
* @since 2.1.0
436429
*/
437-
@Incubating
438430
public static <T, A, B, C, D> Answer<T> answer(Answer4<T, A, B, C, D> answer) {
439431
return toAnswer(answer);
440432
}
@@ -450,7 +442,6 @@ public static <T, A, B, C, D> Answer<T> answer(Answer4<T, A, B, C, D> answer) {
450442
* @return the answer object to use
451443
* @since 2.1.0
452444
*/
453-
@Incubating
454445
public static <A, B, C, D> Answer<Void> answerVoid(VoidAnswer4<A, B, C, D> answer) {
455446
return toAnswer(answer);
456447
}
@@ -468,7 +459,6 @@ public static <A, B, C, D> Answer<Void> answerVoid(VoidAnswer4<A, B, C, D> answe
468459
* @return the answer object to use
469460
* @since 2.1.0
470461
*/
471-
@Incubating
472462
public static <T, A, B, C, D, E> Answer<T> answer(Answer5<T, A, B, C, D, E> answer) {
473463
return toAnswer(answer);
474464
}
@@ -486,7 +476,6 @@ public static <T, A, B, C, D, E> Answer<T> answer(Answer5<T, A, B, C, D, E> answ
486476
* @return the answer object to use
487477
* @since 2.1.0
488478
*/
489-
@Incubating
490479
public static <A, B, C, D, E> Answer<Void> answerVoid(VoidAnswer5<A, B, C, D, E> answer) {
491480
return toAnswer(answer);
492481
}
@@ -506,7 +495,6 @@ public static <A, B, C, D, E> Answer<Void> answerVoid(VoidAnswer5<A, B, C, D, E>
506495
* @return the answer object to use
507496
* @since 2.26.0
508497
*/
509-
@Incubating
510498
public static <T, A, B, C, D, E, F> Answer<T> answer(Answer6<T, A, B, C, D, E, F> answer) {
511499
return toAnswer(answer);
512500
}
@@ -525,7 +513,6 @@ public static <T, A, B, C, D, E, F> Answer<T> answer(Answer6<T, A, B, C, D, E, F
525513
* @return the answer object to use
526514
* @since 2.26.0
527515
*/
528-
@Incubating
529516
public static <A, B, C, D, E, F> Answer<Void> answerVoid(VoidAnswer6<A, B, C, D, E, F> answer) {
530517
return toAnswer(answer);
531518
}

src/main/java/org/mockito/MockSettings.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ public interface MockSettings extends Serializable {
255255
* @return settings instance so that you can fluently specify other settings
256256
* @since 2.11.0
257257
*/
258-
@Incubating
259258
MockSettings verificationStartedListeners(VerificationStartedListener... listeners);
260259

261260
/**
@@ -296,7 +295,6 @@ public interface MockSettings extends Serializable {
296295
* @return settings instance so that you can fluently specify other settings
297296
* @since 2.7.14 (useConstructor with no arguments was supported since 1.10.12)
298297
*/
299-
@Incubating
300298
MockSettings useConstructor(Object... args);
301299

302300
/**
@@ -311,7 +309,6 @@ public interface MockSettings extends Serializable {
311309
* @return settings instance so that you can fluently specify other settings
312310
* @since 1.10.12
313311
*/
314-
@Incubating
315312
MockSettings outerInstance(Object outerClassInstance);
316313

317314
/**
@@ -322,7 +319,6 @@ public interface MockSettings extends Serializable {
322319
* @return settings instance so that you can fluently specify other settings
323320
* @since 1.10.13
324321
*/
325-
@Incubating
326322
MockSettings withoutAnnotations();
327323

328324
/**
@@ -337,7 +333,6 @@ public interface MockSettings extends Serializable {
337333
* @return immutable view of mock settings
338334
* @since 2.10.0
339335
*/
340-
@Incubating
341336
<T> MockCreationSettings<T> build(Class<T> typeToMock);
342337

343338
/**
@@ -352,7 +347,6 @@ public interface MockSettings extends Serializable {
352347
* @return immutable view of mock settings
353348
* @since 2.10.0
354349
*/
355-
@Incubating
356350
<T> MockCreationSettings<T> buildStatic(Class<T> classToMock);
357351

358352
/**
@@ -366,6 +360,5 @@ public interface MockSettings extends Serializable {
366360
*
367361
* For more information and an elaborate example, see {@link Mockito#lenient()}.
368362
*/
369-
@Incubating
370363
MockSettings lenient();
371364
}

src/main/java/org/mockito/MockedConstruction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*
2020
* @param <T> The type for which the construction is being mocked.
2121
*/
22-
@Incubating
2322
public interface MockedConstruction<T> extends ScopedMock {
2423

2524
List<T> constructed();

src/main/java/org/mockito/MockedStatic.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*
2424
* @param <T> The type being mocked.
2525
*/
26-
@Incubating
2726
public interface MockedStatic<T> extends ScopedMock {
2827

2928
/**

src/main/java/org/mockito/MockingDetails.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public interface MockingDetails {
117117
* @return mock handler instance of this mock
118118
* @since 2.10.0
119119
*/
120-
@Incubating
121120
MockHandler getMockHandler();
122121

123122
/**

src/main/java/org/mockito/Mockito.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,6 @@ public static <T> T spy(T object) {
20682068
* @return a spy of the provided class
20692069
* @since 1.10.12
20702070
*/
2071-
@Incubating
20722071
public static <T> T spy(Class<T> classToSpy) {
20732072
return MOCKITO_CORE.mock(
20742073
classToSpy, withSettings().useConstructor().defaultAnswer(CALLS_REAL_METHODS));
@@ -2090,7 +2089,6 @@ public static <T> T spy(Class<T> classToSpy) {
20902089
* @param classToMock class or interface of which static mocks should be mocked.
20912090
* @return mock controller
20922091
*/
2093-
@Incubating
20942092
public static <T> MockedStatic<T> mockStatic(Class<T> classToMock) {
20952093
return mockStatic(classToMock, withSettings());
20962094
}
@@ -2112,7 +2110,6 @@ public static <T> MockedStatic<T> mockStatic(Class<T> classToMock) {
21122110
* @param defaultAnswer the default answer when invoking static methods.
21132111
* @return mock controller
21142112
*/
2115-
@Incubating
21162113
public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, Answer defaultAnswer) {
21172114
return mockStatic(classToMock, withSettings().defaultAnswer(defaultAnswer));
21182115
}
@@ -2134,7 +2131,6 @@ public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, Answer defaul
21342131
* @param name the name of the mock to use in error messages.
21352132
* @return mock controller
21362133
*/
2137-
@Incubating
21382134
public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, String name) {
21392135
return mockStatic(classToMock, withSettings().name(name));
21402136
}
@@ -2156,7 +2152,6 @@ public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, String name)
21562152
* @param mockSettings the settings to use where only name and default answer are considered.
21572153
* @return mock controller
21582154
*/
2159-
@Incubating
21602155
public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, MockSettings mockSettings) {
21612156
return MOCKITO_CORE.mockStatic(classToMock, mockSettings);
21622157
}
@@ -2174,7 +2169,6 @@ public static <T> MockedStatic<T> mockStatic(Class<T> classToMock, MockSettings
21742169
* last answer is used. If this array is empty, the {@code defaultAnswer} is used.
21752170
* @return mock controller
21762171
*/
2177-
@Incubating
21782172
public static <T> MockedConstruction<T> mockConstructionWithAnswer(
21792173
Class<T> classToMock, Answer defaultAnswer, Answer... additionalAnswers) {
21802174
return mockConstruction(
@@ -2203,7 +2197,6 @@ public static <T> MockedConstruction<T> mockConstructionWithAnswer(
22032197
* @param classToMock non-abstract class of which constructions should be mocked.
22042198
* @return mock controller
22052199
*/
2206-
@Incubating
22072200
public static <T> MockedConstruction<T> mockConstruction(Class<T> classToMock) {
22082201
return mockConstruction(classToMock, index -> withSettings(), (mock, context) -> {});
22092202
}
@@ -2219,7 +2212,6 @@ public static <T> MockedConstruction<T> mockConstruction(Class<T> classToMock) {
22192212
* @param mockInitializer a callback to prepare a mock's methods after its instantiation.
22202213
* @return mock controller
22212214
*/
2222-
@Incubating
22232215
public static <T> MockedConstruction<T> mockConstruction(
22242216
Class<T> classToMock, MockedConstruction.MockInitializer<T> mockInitializer) {
22252217
return mockConstruction(classToMock, withSettings(), mockInitializer);
@@ -2236,7 +2228,6 @@ public static <T> MockedConstruction<T> mockConstruction(
22362228
* @param mockSettings the mock settings to use.
22372229
* @return mock controller
22382230
*/
2239-
@Incubating
22402231
public static <T> MockedConstruction<T> mockConstruction(
22412232
Class<T> classToMock, MockSettings mockSettings) {
22422233
return mockConstruction(classToMock, context -> mockSettings);
@@ -2253,7 +2244,6 @@ public static <T> MockedConstruction<T> mockConstruction(
22532244
* @param mockSettingsFactory the mock settings to use.
22542245
* @return mock controller
22552246
*/
2256-
@Incubating
22572247
public static <T> MockedConstruction<T> mockConstruction(
22582248
Class<T> classToMock,
22592249
Function<MockedConstruction.Context, MockSettings> mockSettingsFactory) {
@@ -2272,7 +2262,6 @@ public static <T> MockedConstruction<T> mockConstruction(
22722262
* @param mockInitializer a callback to prepare a mock's methods after its instantiation.
22732263
* @return mock controller
22742264
*/
2275-
@Incubating
22762265
public static <T> MockedConstruction<T> mockConstruction(
22772266
Class<T> classToMock,
22782267
MockSettings mockSettings,
@@ -2292,7 +2281,6 @@ public static <T> MockedConstruction<T> mockConstruction(
22922281
* @param mockInitializer a callback to prepare a mock's methods after its instantiation.
22932282
* @return mock controller
22942283
*/
2295-
@Incubating
22962284
public static <T> MockedConstruction<T> mockConstruction(
22972285
Class<T> classToMock,
22982286
Function<MockedConstruction.Context, MockSettings> mockSettingsFactory,
@@ -3257,7 +3245,6 @@ public static VerificationMode description(String description) {
32573245
*
32583246
* @since 2.1.0
32593247
*/
3260-
@Incubating
32613248
public static MockitoFramework framework() {
32623249
return new DefaultMockitoFramework();
32633250
}
@@ -3270,7 +3257,6 @@ public static MockitoFramework framework() {
32703257
*
32713258
* @since 2.7.0
32723259
*/
3273-
@Incubating
32743260
public static MockitoSessionBuilder mockitoSession() {
32753261
return new DefaultMockitoSessionBuilder();
32763262
}
@@ -3338,7 +3324,6 @@ public static MockitoSessionBuilder mockitoSession() {
33383324
*
33393325
* @since 2.20.0
33403326
*/
3341-
@Incubating
33423327
public static LenientStubber lenient() {
33433328
return MOCKITO_CORE.lenient();
33443329
}

src/main/java/org/mockito/MockitoFramework.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*
2020
* @since 2.1.0
2121
*/
22-
@Incubating
2322
@NotExtensible
2423
public interface MockitoFramework {
2524

@@ -53,7 +52,6 @@ public interface MockitoFramework {
5352
* @return this instance of mockito framework (fluent builder pattern)
5453
* @since 2.1.0
5554
*/
56-
@Incubating
5755
MockitoFramework addListener(MockitoListener listener) throws RedundantListenerException;
5856

5957
/**
@@ -70,7 +68,6 @@ public interface MockitoFramework {
7068
* @return this instance of mockito framework (fluent builder pattern)
7169
* @since 2.1.0
7270
*/
73-
@Incubating
7471
MockitoFramework removeListener(MockitoListener listener);
7572

7673
/**
@@ -81,7 +78,6 @@ public interface MockitoFramework {
8178
* @return object that gives access to mockito plugins
8279
* @since 2.10.0
8380
*/
84-
@Incubating
8581
MockitoPlugins getPlugins();
8682

8783
/**
@@ -91,7 +87,6 @@ public interface MockitoFramework {
9187
* @return object that can construct invocations
9288
* @since 2.10.0
9389
*/
94-
@Incubating
9590
InvocationFactory getInvocationFactory();
9691

9792
/**
@@ -130,7 +125,6 @@ public interface MockitoFramework {
130125
* @since 2.25.0
131126
* @see #clearInlineMock(Object)
132127
*/
133-
@Incubating
134128
void clearInlineMocks();
135129

136130
/**
@@ -142,6 +136,5 @@ public interface MockitoFramework {
142136
* @since 2.25.0
143137
* @see #clearInlineMocks()
144138
*/
145-
@Incubating
146139
void clearInlineMock(Object mock);
147140
}

src/main/java/org/mockito/MockitoSession.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
*
8787
* @since 2.7.0
8888
*/
89-
@Incubating
9089
@NotExtensible
9190
public interface MockitoSession {
9291

@@ -101,7 +100,6 @@ public interface MockitoSession {
101100
* @param strictness new strictness for this session.
102101
* @since 2.15.0
103102
*/
104-
@Incubating
105103
void setStrictness(Strictness strictness);
106104

107105
/**
@@ -123,7 +121,6 @@ public interface MockitoSession {
123121
* @see #finishMocking(Throwable)
124122
* @since 2.7.0
125123
*/
126-
@Incubating
127124
void finishMocking();
128125

129126
/**
@@ -140,6 +137,5 @@ public interface MockitoSession {
140137
* @see #finishMocking()
141138
* @since 2.15.0
142139
*/
143-
@Incubating
144140
void finishMocking(Throwable failure);
145141
}

src/main/java/org/mockito/ScopedMock.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* Represents a mock with a thread-local explicit scope. Scoped mocks must be closed by the entity
99
* that activates the scoped mock.
1010
*/
11-
@Incubating
1211
public interface ScopedMock extends AutoCloseable {
1312

1413
/**

0 commit comments

Comments
 (0)
0