}
@Test
public void shouldGetControllerIfHandlerMethod() throws Exception {
Object controller = mock(Object.class, "controller");
HandlerMethod handlerMethod = mock(HandlerMethod.class, "handler");
this.springFacesContext = new DefaultSpringFacesContext(this.lifecycleAccessor, this.webApplicationContext,
this.request, this.response, handlerMethod);
given(handlerMethod.createWithResolvedBean()).willReturn(handlerMethod);
given(handlerMethod.getBean()).willReturn(controller);
assertThat(this.springFacesContext.getController(), is(sameInstance(controller)));
}