org.mockito.internal.configuration.injection.filter.TerminalMockCandidateFilter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-core Show documentation
Show all versions of mockito-core Show documentation
Mockito mock objects library core API and implementation
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.configuration.injection.filter;
import static org.mockito.internal.exceptions.Reporter.cannotInjectDependency;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.List;
import org.mockito.internal.configuration.plugins.Plugins;
import org.mockito.internal.util.reflection.BeanPropertySetter;
import org.mockito.plugins.MemberAccessor;
/**
* This node returns an actual injecter which will be either :
*
*
* - an {@link OngoingInjector} that do nothing if a candidate couldn't be found
* - an {@link OngoingInjector} that will try to inject the candidate trying first the property setter then if not possible try the field access
*
*/
public class TerminalMockCandidateFilter implements MockCandidateFilter {
@Override
public OngoingInjector filterCandidate(
final Collection