/** * Return the BackgroundExecutor. * * Typically for testing we either want these to run immediately or not at all. * Defaults to use ImmediateBackgroundExecutor, use IgnoreBackgroundExecutor if desired. */ @Override public BackgroundExecutor getBackgroundExecutor() { methodCalls.add(MethodCall.of("getBackgroundExecutor")); return backgroundExecutor; }
protected List<MethodCall> matches(String methodName) { List<MethodCall> matches = new ArrayList<MethodCall>(); for (MethodCall call : list) { if (isMatch(call, methodName)) { matches.add(call); } } return matches; }
public List<MethodCall> save() { return matches(DelegateMethodNames.SAVE); }
@Override public ServerCacheManager getServerCacheManager() { methodCalls.add(MethodCall.of("getServerCacheManager")); return delegate.getServerCacheManager(); }
public List<MethodCall> update() { return matches(DelegateMethodNames.UPDATE); }
@Override public Transaction createTransaction() { methodCalls.add(MethodCall.of("createTransaction")); return delegate.createTransaction(); }
public List<MethodCall> delete() { return matches(DelegateMethodNames.DELETE); }
@Override public Transaction currentTransaction() { methodCalls.add(MethodCall.of("currentTransaction")); return delegate.currentTransaction(); }
public List<MethodCall> insert() { return matches(DelegateMethodNames.INSERT); }
@Override public AutoTune getAutoTune() { methodCalls.add(MethodCall.of("getAutoTune")); return delegate.getAutoTune(); }
@Override public String getName() { methodCalls.add(MethodCall.of("getName")); return delegate.getName(); }
@Override public void commitTransaction() { methodCalls.add(MethodCall.of("commitTransaction")); delegate.commitTransaction(); }
@Override public MetaInfoManager getMetaInfoManager() { methodCalls.add(MethodCall.of("getMetaInfoManager")); return delegate.getMetaInfoManager(); }
@Override public void rollbackTransaction() { methodCalls.add(MethodCall.of("rollbackTransaction")); delegate.rollbackTransaction(); }
@Override public DocumentStore docStore() { methodCalls.add(MethodCall.of("docStore")); return delegate.docStore(); }
@Override public void endTransaction() { methodCalls.add(MethodCall.of("endTransaction")); delegate.endTransaction(); }
@Override public Object getBeanId(Object bean) { methodCalls.add(MethodCall.of("getBeanId").with("bean", bean)); return delegate.getBeanId(bean); }
@Override public Map<String, ValuePair> diff(Object a, Object b) { methodCalls.add(MethodCall.of("diff").with("a", a, "b", b)); return delegate.diff(a, b); }
@Override public <T> CsvReader<T> createCsvReader(Class<T> beanType) { methodCalls.add(MethodCall.of("createCsvReader").with("beanType", beanType)); return delegate.createCsvReader(beanType); }
@Override public <T> T execute(TxScope scope, TxCallable<T> callable) { methodCalls.add(MethodCall.of("bulkUpdate").with("scope", scope, "callable", callable)); return delegate.execute(scope, callable); }