@Test
public void testAddAttributeWithHelp() throws Exception {
final String attribute = "form attribute";
final String helpTitle = "help title";
final String helpContent = "help content";
final Widget widget = mock(Widget.class);
final FormStyleItem expectedItem = mock(FormStyleItem.class);
final int expectedAttributeIndex = 123;
doReturn(expectedItem).when(formStyleLayout).addAttribute(attribute,
helpTitle,
helpContent,
widget);
doReturn(expectedAttributeIndex).when(expectedItem).getIndex();
testedPopup.addAttributeWithHelp(attribute,
helpTitle,
helpContent,
widget);
verify(formStyleLayout).addAttribute(attribute,
helpTitle,
helpContent,
widget);
verify(formStyleLayout).setAttributeVisibility(expectedAttributeIndex, true);
}
}