Fixed wrong merge

This commit is contained in:
Marcin Grzejszczak
2018-09-21 12:22:07 +02:00
parent 9d6e91cfbc
commit 331be07fbc

View File

@@ -176,28 +176,4 @@ public class ExecutorBeanPostProcessorTests {
}
}
@Test
public void should_throw_real_exception_when_using_proxy() throws Exception {
// for LazyTraceExecutor
Mockito.when(this.beanFactory.getBean(Tracing.class))
.thenReturn(Tracing.newBuilder().build());
Mockito.when(this.beanFactory.getBean(SpanNamer.class))
.thenReturn(new DefaultSpanNamer());
Object o = new ExecutorBeanPostProcessor(this.beanFactory)
.postProcessAfterInitialization(new RejectedExecutionExecutor(), "fooExecutor");
then(o).isInstanceOf(RejectedExecutionExecutor.class);
then(ClassUtils.isCglibProxy(o)).isTrue();
thenThrownBy(() -> ((RejectedExecutionExecutor) o).execute(() -> {}))
.isInstanceOf(RejectedExecutionException.class)
.hasMessage("rejected");
}
class RejectedExecutionExecutor implements Executor {
@Override public void execute(Runnable task) {
throw new RejectedExecutionException("rejected");
}
}
}