@@ -0,0 +1,1938 @@
+/*%0A * Copyright 2016 The Error Prone Authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.errorprone.annotations;%0A%0Aimport java.lang.annotation.Documented;%0Aimport java.lang.annotation.ElementType;%0Aimport java.lang.annotation.Inherited;%0Aimport java.lang.annotation.Retention;%0Aimport java.lang.annotation.RetentionPolicy;%0Aimport java.lang.annotation.Target;%0A%0A/**%0A * Annotation representing a type that should not be mocked (like %7B@link DoNotMock%7D, but can be%0A * spied. To prevent mocking and spying completely, use %7B@link DoNotMock%7D.%0A *%0A * %3Cp%3EIMPORTANT NOTE: A spy can, by definition, have its methods stubbed out (i.e. it is effectively%0A * a mock, but simply has its default expectations set to proxy to an existing implementation)%0A *%0A * %3Cp%3EWhen marking a type %7B@code @SpyNoMock%7D, you should always point to alternative testing%0A * solutions such as standard fakes or other testing utilities.%0A *%0A * %3Cp%3EMockito tests can enforce this annotation by using a custom MockMaker which intercepts%0A * creation of mocks.%0A */%0A@Inherited%0A@Documented%0A@Retention(RetentionPolicy.RUNTIME)%0A@Target(%7BElementType.TYPE, ElementType.ANNOTATION_TYPE%7D)%0Apublic @interface SpyNoMock %7B%0A  /**%0A   * The reason why the annotated type should not be mocked but can be spied.%0A   *%0A   * %3Cp%3EThis should suggest alternative APIs to use for testing objects of this type.%0A   */%0A  String value() default %22Create a real instance instead%22;%0A%7D%0A

Create @SpyNoMock error prone checker. This will enforce that any classes/interfaces marked with @SpyNoMock aren't being stubbed, but instead must use a fake. This makes @SpyNoMock an error in all cases, whereas @DoNotMock was only a warning for tricorder.