### Question:
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated  SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection();  }### Answer:
@Test public void testSetSectionId() { BaseSection section = createContext(new SCCPmoWithID()).createSection(); assertThat(section.getId(), is("test-ID")); }
@Test public void testSetSectionDefaultId() { BaseSection section = createContext(new SCCPmoWithoutID()).createSection(); assertThat(section.getId(), is("SCCPmoWithoutID")); }
@Test public void testSetComponentId() { BaseSection section = createContext(new SCCPmoWithID()).createSection(); assertThat(section.getComponentCount(), is(2)); assertThat(section.getComponent(0).isVisible(), is(false)); GridLayout gridLayout = TestUiUtil.getContentGrid((FormSection)section); @NonNull Component textField = gridLayout.getComponent(1, 0); assertThat(textField.getId(), is("testProperty")); }
@Test public void testSectionWithDefaultLayout_shouldCreateFormLayout() { BaseSection section = createContext(new SCCPmoWithoutID()).createSection(); assertThat(section, is(instanceOf(FormSection.class))); }
@Test public void testSectionWithHorizontalLayout_shouldCreateHorizontalSection() { BaseSection section = createContext(new SectionWithHorizontalLayout()).createSection(); assertThat(section, is(instanceOf(HorizontalSection.class))); }
@Test public void testSectionWithCustomLayout_shouldCreateCustomLayoutSection() { BaseSection section = createContext(new SectionWithCustomLayout()).createSection(); assertThat(section, is(instanceOf(CustomLayoutSection.class))); }
@Test public void testSectionWithoutAnnotation_usesDefaultValues() { BaseSection section = createContext(new SectionWithoutAnnotation()).createSection(); assertThat(section, is(instanceOf(FormSection.class))); assertThat(section.getId(), is(SectionWithoutAnnotation.class.getSimpleName())); assertThat(section.getCaption(), is(nullValue())); assertThat(((FormSection)section).getNumberOfColumns(), is(1)); }