@Test
public void when_getSubmittedForm_is_called_with_component_in_form_details_provided_then_form_is_returned() {

    // given
    initializeRequestParameterMap(new HashMap<String, String>() {
        {
            put("component", "component");
        }
    });
    UIForm form = mock(UIForm.class);
    UIComponent component = mock(UIComponent.class);
    UIViewRoot viewRoot = mock(UIViewRoot.class);
    when(facesContext.getViewRoot()).thenReturn(viewRoot);
    when(facesContext.getViewRoot().findComponent("component")).thenReturn(component);
    when(component.getParent()).thenReturn(form);
    when(facesContext.isPostback()).thenReturn(true);
    // when
    UIComponent result = utils.getSubmittedForm(facesContext);
    // then
    assertEquals(form, result);
}