|
|
|
@ -25,6 +25,8 @@ import org.mockito.ArgumentMatchers; |
|
|
|
import org.mockito.Mockito; |
|
|
|
import org.mockito.Mockito; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
import org.springframework.beans.factory.BeanFactory; |
|
|
|
|
|
|
|
import org.springframework.context.ApplicationEventPublisher; |
|
|
|
|
|
|
|
import org.springframework.context.ApplicationEventPublisherAware; |
|
|
|
import org.springframework.core.metrics.ApplicationStartup; |
|
|
|
import org.springframework.core.metrics.ApplicationStartup; |
|
|
|
import org.springframework.core.metrics.StartupStep; |
|
|
|
import org.springframework.core.metrics.StartupStep; |
|
|
|
import org.springframework.data.projection.ProjectionFactory; |
|
|
|
import org.springframework.data.projection.ProjectionFactory; |
|
|
|
@ -46,7 +48,7 @@ import org.springframework.data.repository.query.ValueExpressionDelegate; |
|
|
|
* @author Oliver Gierke |
|
|
|
* @author Oliver Gierke |
|
|
|
* @author Christoph Strobl |
|
|
|
* @author Christoph Strobl |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class DummyRepositoryFactory extends RepositoryFactorySupport { |
|
|
|
public class DummyRepositoryFactory extends RepositoryFactorySupport implements ApplicationEventPublisherAware { |
|
|
|
|
|
|
|
|
|
|
|
public final MyRepositoryQuery queryOne = mock(MyRepositoryQuery.class); |
|
|
|
public final MyRepositoryQuery queryOne = mock(MyRepositoryQuery.class); |
|
|
|
public final RepositoryQuery queryTwo = mock(RepositoryQuery.class); |
|
|
|
public final RepositoryQuery queryTwo = mock(RepositoryQuery.class); |
|
|
|
@ -54,6 +56,8 @@ public class DummyRepositoryFactory extends RepositoryFactorySupport { |
|
|
|
|
|
|
|
|
|
|
|
private final ApplicationStartup applicationStartup; |
|
|
|
private final ApplicationStartup applicationStartup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationEventPublisher publisher; |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") private final QuerydslPredicateExecutor<Object> querydsl = mock( |
|
|
|
@SuppressWarnings("unchecked") private final QuerydslPredicateExecutor<Object> querydsl = mock( |
|
|
|
QuerydslPredicateExecutor.class); |
|
|
|
QuerydslPredicateExecutor.class); |
|
|
|
private final Object repository; |
|
|
|
private final Object repository; |
|
|
|
@ -97,6 +101,15 @@ public class DummyRepositoryFactory extends RepositoryFactorySupport { |
|
|
|
return Optional.of(strategy); |
|
|
|
return Optional.of(strategy); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ApplicationEventPublisher getPublisher() { |
|
|
|
|
|
|
|
return publisher; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setApplicationEventPublisher(ApplicationEventPublisher publisher) { |
|
|
|
|
|
|
|
this.publisher = publisher; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) { |
|
|
|
protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) { |
|
|
|
|
|
|
|
|
|
|
|
|