All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.mockito.internal.configuration.DefaultInjectionEngine Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * Copyright (c) 2007 Mockito contributors
 * This program is made available under the terms of the MIT License.
 */
package com.fitbur.mockito.internal.configuration;

import java.lang.reflect.Field;
import java.util.Set;

import com.fitbur.mockito.internal.configuration.injection.MockInjection;

/**
 * Inject mock/spies dependencies for fields annotated with @InjectMocks
 * 

* See {@link com.fitbur.mockito.MockitoAnnotations} */ public class DefaultInjectionEngine { public void injectMocksOnFields(Set needingInjection, Set mocks, Object testClassInstance) { MockInjection.onFields(needingInjection, testClassInstance) .withMocks(mocks) .tryConstructorInjection() .tryPropertyOrFieldInjection() .handleSpyAnnotation() .apply(); } }