Coverage Report - org.doxla.spring.automock.annotation.AutoMocked
 
Classes in this File Line Coverage Branch Coverage Complexity
AutoMocked
N/A 
N/A 
0
 
 1  
 /**
 2  
    Copyright 2007 Dan Oxlade
 3  
 
 4  
    Licensed under the Apache License, Version 2.0 (the "License");
 5  
    you may not use this file except in compliance with the License.
 6  
    You may obtain a copy of the License at
 7  
 
 8  
        http://www.apache.org/licenses/LICENSE-2.0
 9  
 
 10  
    Unless required by applicable law or agreed to in writing, software
 11  
    distributed under the License is distributed on an "AS IS" BASIS,
 12  
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
    See the License for the specific language governing permissions and
 14  
    limitations under the License.
 15  
  */
 16  
 package org.doxla.spring.automock.annotation;
 17  
 
 18  
 import java.lang.annotation.Documented;
 19  
 import java.lang.annotation.ElementType;
 20  
 import java.lang.annotation.Retention;
 21  
 import java.lang.annotation.RetentionPolicy;
 22  
 import java.lang.annotation.Target;
 23  
 
 24  
 /**
 25  
  * This annotation signals that the annotated type is subject to Automocking.
 26  
  * 
 27  
  * Developers should use this documentation level annotation to state that
 28  
  * the type is subject to Automocking and thus available in one or more
 29  
  * Spring application contexts associated with a testing framework.
 30  
  * It should also detail the name of the exposed Spring bean as a 
 31  
  * result of Automocking.
 32  
  * 
 33  
  * This will be useful when dealing with some of the implicit mock resolving
 34  
  * strategies such as the {@link InterfaceOnlyPatternMatchingMockResolver} 
 35  
  * where it is not imediately obvious as to where the injected {@link Mock} or
 36  
  * indeed proxy is registered with Spring.
 37  
  * 
 38  
  * For instance if you are using the AutoMock framework with the 
 39  
  * {@link DefaultProxyMockNameResolver} then your mockName attribute 
 40  
  * will typically be 'mock[Type]' where [Type] is replaced with the
 41  
  * class name of the Type this annotation targets.
 42  
  * 
 43  
  * For an example @see {@link SimpleTestService}
 44  
  *  
 45  
  * @author danoxlade
 46  
  */
 47  
 @Documented
 48  
 @Retention(RetentionPolicy.SOURCE)
 49  
 @Target(ElementType.TYPE)
 50  
 public @interface AutoMocked {
 51  
         
 52  
         String mockName();
 53  
 
 54  
 }