ForwardingEvalContext implements EvalContext { @Override public <T> Value<T> evaluateInternal(Task<T> task, EvalContext context) { return delegate.evaluateInternal(task, context); } protected  ForwardingEvalContext(EvalContext delegate); @Override Value<T> evaluateInternal(Task<T> task, EvalContext context); @Override Value<T> invokeProcessFn(TaskId taskId, Fn<T> processFn); @Override Value<T> value(Fn<T> value); @Override Value<T> immediateValue(T value); @Override Promise<T> promise(); @Override Listener listener();  }
@Test public void evaluate() throws Exception { sut.evaluate(TASK); ArgumentCaptor<EvalContext> contextArgumentCaptor = ArgumentCaptor.forClass(EvalContext.class); verify(delegate).evaluateInternal(eq(TASK), contextArgumentCaptor.capture()); EvalContext capturedContext = contextArgumentCaptor.getValue(); assertThat(capturedContext.getClass(), typeCompatibleWith(EvalContextWithTask.class)); EvalContextWithTask wrapperContext = (EvalContextWithTask) capturedContext; assertThat(wrapperContext.delegate, is(sut)); }
@Test public void evaluateInternal() throws Exception { sut.evaluateInternal(TASK, delegate); verify(delegate).evaluateInternal(TASK, delegate); }