Home | History | Annotate | Download | only in configuration
      1 /*
      2  * Copyright (c) 2007 Mockito contributors
      3  * This program is made available under the terms of the MIT License.
      4  */
      5 package org.mockito.configuration;
      6 
      7 import org.mockito.ReturnValues;
      8 import org.mockito.internal.configuration.InjectingAnnotationEngine;
      9 import org.mockito.internal.stubbing.defaultanswers.ReturnsEmptyValues;
     10 import org.mockito.stubbing.Answer;
     11 
     12 /**
     13  * DefaultConfiguration of Mockito framework
     14  * <p>
     15  * Currently it doesn't have many configuration options but it will probably change if future.
     16  * <p>
     17  * See javadocs for {@link IMockitoConfiguration} on info how to configure Mockito
     18  */
     19 @SuppressWarnings("deprecation")//supressed until ReturnValues are removed
     20 public class DefaultMockitoConfiguration implements IMockitoConfiguration {
     21 
     22     /* (non-Javadoc)
     23      * @see org.mockito.IMockitoConfiguration#getReturnValues()
     24      */
     25     @Deprecated
     26     public ReturnValues getReturnValues() {
     27         throw new RuntimeException("\n" + "This method should not be used by the framework because it was deprecated"
     28                 + "\n" + "Please report the failure to the Mockito mailing list");
     29     }
     30 
     31     public Answer<Object> getDefaultAnswer() {
     32         return new ReturnsEmptyValues();
     33     }
     34 
     35     /* (non-Javadoc)
     36      * @see org.mockito.IMockitoConfiguration#getAnnotationEngine()
     37      */
     38     public AnnotationEngine getAnnotationEngine() {
     39         return new InjectingAnnotationEngine();
     40     }
     41 
     42     /* (non-Javadoc)
     43      * @see org.mockito.configuration.IMockitoConfiguration#cleansStackTrace()
     44      */
     45     public boolean cleansStackTrace() {
     46         return true;
     47     }
     48 
     49     /* (non-Javadoc)
     50      * @see org.mockito.configuration.IMockitoConfiguration#enableClassCache()
     51      */
     52     public boolean enableClassCache() {
     53         return true;
     54     }
     55 
     56 
     57 }