/**
* @bug #337
*/
@Test
public void shouldForwardToTheRightDefaultValue() throws Exception {
Result result = mock(Result.class);
PageResult pageResult = new DefaultPageResult(request, response, methodInfo, resolver, proxifier);
when(result.use(PageResult.class)).thenReturn(pageResult);
when(container.instanceFor(TheComponent.class)).thenReturn(new TheComponent(result));
when(resolver.pathFor(argThat(sameMethodAs(TheComponent.class.getDeclaredMethod("method"))))).thenReturn("controlled!");
when(request.getRequestDispatcher(anyString())).thenThrow(new AssertionError("should have called with the right method!"));
doReturn(dispatcher).when(request).getRequestDispatcher("controlled!");