org.mockito.internal.configuration.MockitoAnnotationsMockAnnotationProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-all Show documentation
Show all versions of mockito-all Show documentation
Mock objects library for java
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.configuration;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations.Mock;
import java.lang.reflect.Field;
/**
* Instantiates a mock on a field annotated by {@link Mock}
*/
@SuppressWarnings("deprecation")
public class MockitoAnnotationsMockAnnotationProcessor implements FieldAnnotationProcessor {
public Object process(Mock annotation, Field field) {
return Mockito.mock(field.getType(), field.getName());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy