Package net.shibboleth.shared.testing

# Class MockResolver<T>

java.lang.Object
net.shibboleth.shared.testing.MockResolver<T>

Type Parameters:
  `T` - type of object being resolved

All Implemented Interfaces:
  `Resolver<T,CriteriaSet>`

public class MockResolver<T> extends Object implements Resolver<T,CriteriaSet>
Mock `Resolver` for tests.

Since:
  9.1.3

## Constructor Summary

Constructors
Constructor
Description
`MockResolver()`

## Method Summary

Modifier and Type
Method
Description
`Iterable<T>`
`resolve(CriteriaSet criteria)`
Process the specified criteria and return the resulting instances of the product type which satisfy the criteria.
`T`
`resolveSingle(CriteriaSet criteria)`
Process the specified criteria and return a single instance of the product type which satisfies the criteria.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockResolver

public MockResolver()

## Method Details

### resolve

@Nonnull public Iterable<T> resolve(@Nullable CriteriaSet criteria) throws ResolverException
Process the specified criteria and return the resulting instances of the product type which satisfy the criteria.

Specified by:
  `resolve` in interface `Resolver<T,CriteriaSet>`
Parameters:
  `criteria` - the criteria to evaluate or process
Returns:
  instances which satisfy the criteria
Throws:
  `ResolverException` - thrown if there is an error processing the specified criteria

### resolveSingle

@Nullable public T resolveSingle(@Nullable CriteriaSet criteria) throws ResolverException
Process the specified criteria and return a single instance of the product type which satisfies the criteria. If multiple items satisfy the criteria, the choice of which single item to return is implementation-dependent.

Specified by:
  `resolveSingle` in interface `Resolver<T,CriteriaSet>`
Parameters:
  `criteria` - the criteria to evaluate or process
Returns:
  a single instance satisfying the criteria, or null
Throws:
  `ResolverException` - thrown if there is an error processing the specified criteria