codenarc
This commit is contained in:
parent
dfcf9c6abd
commit
001d1d8282
|
@ -24,13 +24,15 @@ class Elasticsearch53SpringRepositoryTest extends AgentTestRunner {
|
||||||
DocRepository repo = Proxy.newProxyInstance(
|
DocRepository repo = Proxy.newProxyInstance(
|
||||||
getClass().getClassLoader(),
|
getClass().getClassLoader(),
|
||||||
[DocRepository] as Class[],
|
[DocRepository] as Class[],
|
||||||
new LazyProxyInvoker());
|
new LazyProxyInvoker())
|
||||||
|
|
||||||
static class LazyProxyInvoker implements InvocationHandler {
|
static class LazyProxyInvoker implements InvocationHandler {
|
||||||
def repo;
|
def repo
|
||||||
|
|
||||||
DocRepository getOrCreateRepository() {
|
DocRepository getOrCreateRepository() {
|
||||||
if ( repo != null ) return repo;
|
if (repo != null) {
|
||||||
|
return repo
|
||||||
|
}
|
||||||
|
|
||||||
TEST_WRITER.clear()
|
TEST_WRITER.clear()
|
||||||
runUnderTrace("setup") {
|
runUnderTrace("setup") {
|
||||||
|
|
Loading…
Reference in New Issue