org.mockito.internal.util.collections.ListUtil Java Examples

The following examples show how to use org.mockito.internal.util.collections.ListUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyAndSetterInjection.java    From COLA with GNU Lesser General Public License v2.1 5 votes vote down vote up
private List<Field> orderedInstanceFieldsFrom(Class<?> awaitingInjectionClazz) {
    List<Field> declaredFields = Arrays.asList(awaitingInjectionClazz.getDeclaredFields());
    declaredFields = ListUtil.filter(declaredFields, notFinalOrStatic);

    Collections.sort(declaredFields, superTypesLast);

    return declaredFields;
}
 
Example #2
Source File: InvocationsFinder.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public Invocation findPreviousVerifiedInOrder(List<Invocation> invocations, InOrderContext context) {
    LinkedList<Invocation> verifiedOnly = ListUtil.filter(invocations, new RemoveUnverifiedInOrder(context));
    
    if (verifiedOnly.isEmpty()) {
        return null;
    } else {
        return verifiedOnly.getLast();
    }
}
 
Example #3
Source File: PropertyAndSetterInjection.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private List<Field> orderedInstanceFieldsFrom(Class<?> awaitingInjectionClazz) {
    List<Field> declaredFields = Arrays.asList(awaitingInjectionClazz.getDeclaredFields());
    declaredFields = ListUtil.filter(declaredFields, notFinalOrStatic);

    Collections.sort(declaredFields, superTypesLast);

    return declaredFields;
}
 
Example #4
Source File: DefaultRegisteredInvocations.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public List<Invocation> getAll() {
  	List<Invocation> copiedList;
  	synchronized (invocations) {
	copiedList = new LinkedList<Invocation>(invocations) ;
}

      return ListUtil.filter(copiedList, new RemoveToString());
  }
 
Example #5
Source File: InvocationsFinder.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public List<Invocation> findInvocations(List<Invocation> invocations, InvocationMatcher wanted) {
    return ListUtil.filter(invocations, new RemoveNotMatching(wanted));
}
 
Example #6
Source File: InvocationsFinder.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public List<Invocation> findAllMatchingUnverifiedChunks(List<Invocation> invocations, InvocationMatcher wanted, InOrderContext orderingContext) {
    List<Invocation> unverified = removeVerifiedInOrder(invocations, orderingContext);
    return ListUtil.filter(unverified, new RemoveNotMatching(wanted));
}
 
Example #7
Source File: VerifiableInvocationsFinder.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public List<Invocation> find(List<?> mocks) {
    List<Invocation> invocations = new AllInvocationsFinder().find(mocks);
    return ListUtil.filter(invocations, new RemoveIgnoredForVerification());
}
 
Example #8
Source File: Fields.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public InstanceFields filter(Filter<InstanceField> withFilter) {
    return new InstanceFields(instance, ListUtil.filter(instanceFields, withFilter));
}