@Test public void testFindMatchingClass() { QueryResults findMatchingResult = mock(QueryResults.class); QueryByCriteria query = QueryByCriteria.Builder.create().build(); when(mockProvider.findMatching(any(Class.class), any(QueryByCriteria.class))).thenReturn(findMatchingResult); assertSame(findMatchingResult, service.findMatching(Object.class, query)); verify(mockProvider).findMatching(any(Class.class), eq(query)); }
@Override public <T> QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria) { return persistenceProviderForType(type).findMatching(type, queryByCriteria); }
ProviderBasedDataObjectService implements DataObjectService { @Override public <T> QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria) { return persistenceProviderForType(type).findMatching(type, queryByCriteria); } }
ProviderBasedDataObjectService implements DataObjectService { @Override public <T> QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria) { return persistenceProviderForType(type).findMatching(type, queryByCriteria); }  }
ProviderBasedDataObjectService implements DataObjectService { @Override public <T> QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria) { return persistenceProviderForType(type).findMatching(type, queryByCriteria); }  @Override T find(Class<T> type, Object id); @Override QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria); @Override QueryResults<T> findAll(Class<T> type); @Override T findUnique(Class<T> type, QueryByCriteria queryByCriteria); @Override void delete(Object dataObject); @Override void deleteMatching(Class<T> type, QueryByCriteria queryByCriteria); @Override void deleteAll(Class<T> type); @Override T save(T dataObject, PersistenceOption... options); @Override MetadataRepository getMetadataRepository(); @Override T copyInstance(T dataObject, CopyOption... options); @Override DataObjectWrapper<T> wrap(T dataObject); @Override boolean supports(Class<T> type); @Override void flush(Class<?> type); @Required void setProviderRegistry(ProviderRegistry providerRegistry); @Required void setMetadataRepository(MetadataRepository metadataRepository); ReferenceLinker getReferenceLinker(); @Required void setReferenceLinker(ReferenceLinker referenceLinker); }
ProviderBasedDataObjectService implements DataObjectService { @Override public <T> QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria) { return persistenceProviderForType(type).findMatching(type, queryByCriteria); }  @Override T find(Class<T> type, Object id); @Override QueryResults<T> findMatching(Class<T> type, QueryByCriteria queryByCriteria); @Override QueryResults<T> findAll(Class<T> type); @Override T findUnique(Class<T> type, QueryByCriteria queryByCriteria); @Override void delete(Object dataObject); @Override void deleteMatching(Class<T> type, QueryByCriteria queryByCriteria); @Override void deleteAll(Class<T> type); @Override T save(T dataObject, PersistenceOption... options); @Override MetadataRepository getMetadataRepository(); @Override T copyInstance(T dataObject, CopyOption... options); @Override DataObjectWrapper<T> wrap(T dataObject); @Override boolean supports(Class<T> type); @Override void flush(Class<?> type); @Required void setProviderRegistry(ProviderRegistry providerRegistry); @Required void setMetadataRepository(MetadataRepository metadataRepository); ReferenceLinker getReferenceLinker(); @Required void setReferenceLinker(ReferenceLinker referenceLinker);  }