@Nullable @Override public <T> T resolve(Class<T> type, Optional<Type> typeInfo, String name, Collection<Annotation> annotations) { for (Annotation annotation : annotations) { if (annotation instanceof Incubating) { return type.cast("Custom Value For @Incubating Field"); } } throw new UnsupportedOperationException(getClass().getSimpleName() + " cannot resolve type " + type.getSimpleName()); }
/** * Delegates call to {@link Mockito#spy(Class)}. */ @Incubating default <T> T spy(Class<T> classToSpy) { return Mockito.spy(classToSpy); }
/** * Takes an invocation object and handles it. * <p> * The default implementation provided by Mockito handles invocations by recording * method calls on mocks for further verification, captures the stubbing information when mock is stubbed, * returns the stubbed values for invocations that have been stubbed, and much more. * * @param invocation The invocation to handle * @return Result * @throws Throwable Throwable */ @Incubating Object handle(Invocation invocation) throws Throwable;