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.internal.configuration;
6 
7 import org.mockito.Mockito;
8 import org.mockito.MockitoAnnotations.Mock;
9 
10 import java.lang.reflect.Field;
11 
12 /**
13  * Instantiates a mock on a field annotated by {@link Mock}
14  */
15 @SuppressWarnings("deprecation")
16 public class MockitoAnnotationsMockAnnotationProcessor implements FieldAnnotationProcessor<Mock> {
17 
process(Mock annotation, Field field)18     public Object process(Mock annotation, Field field) {
19         return Mockito.mock(field.getType(), field.getName());
20     }
21 }
22