ItemEditingBoxPresenter extends EditingBoxPresenter implements ItemEditingBox.Presenter { protected void addExpandableItemEditingBox(ItemEditingBox containerItemEditingBox, Map<String, String> propertiesMap, String key, String propertyName) { final ItemEditingBox listEditingBox = viewsProvider.getItemEditingBox(); listEditingBox.init(this); listEditingBox.setKey(key); listEditingBox.getEditingBoxTitle().setInnerText(propertyName); listEditingBox.removeButtonToolbar(); nestedPropertiesNamesList.add(propertyName); for (Map.Entry<String, String> entry : propertiesMap.entrySet()) { String propertyKey = entry.getKey(); listEditingBox.getPropertiesContainer().appendChild(propertyPresenter.getEditingPropertyFields(propertyName, propertyKey, "")); } containerItemEditingBox.getPropertiesContainer().appendChild(listEditingBox.getEditingBox()); }  @Override LIElement getEditingBox(String key, Map<String, String> simplePropertiesMap, Map<String, Map<String, String>> expandablePropertiesMap); @Override void save();  }
@Test public void addExpandableItemEditingBox() { reset(propertyPresenterMock); assertFalse(nestedPropertiesNamesListLocal.contains(TEST_KEY)); ItemEditingBox containerItemEditingBoxMock = mock(ItemEditingBox.class); UListElement containerPropertiesContainerMock = mock(UListElement.class); when(containerItemEditingBoxMock.getPropertiesContainer()).thenReturn(containerPropertiesContainerMock); ((ItemEditingBoxPresenter)editingBoxPresenter).addExpandableItemEditingBox(containerItemEditingBoxMock, TEST_INSTANCE_PROPERTY_MAP, TEST_KEY, TEST_PROPERTYNAME); verify(viewsProviderMock, times(1)).getItemEditingBox(); verify(listEditingBoxMock, times(1)).init(((ItemEditingBoxPresenter)editingBoxPresenter)); verify(listEditingBoxMock, times(1)).setKey(TEST_KEY); verify(editingBoxTitleMock, times(1)).setInnerText(TEST_PROPERTYNAME); verify(listEditingBoxMock, times(1)).removeButtonToolbar(); assertTrue(nestedPropertiesNamesListLocal.contains(TEST_PROPERTYNAME)); verify(propertyPresenterMock, times(1)).getEditingPropertyFields(eq(TEST_PROPERTYNAME), eq(MAP_TEST_KEY), eq("")); verify(propertiesContainerMock, times(1)).appendChild(any()); verify(containerPropertiesContainerMock, times(1)).appendChild(eq(editingBoxMock)); }