KeyValueEditingBoxPresenter extends EditingBoxPresenter implements KeyValueEditingBox.Presenter { @Override public LIElement getEditingBox(String key, Map<String, String> keyPropertyMap, Map<String, String> valuePropertyMap) { String propertyName = key.substring(key.lastIndexOf("#") + 1); final KeyValueEditingBox mapEditingBox = viewsProvider.getKeyValueEditingBox(); mapEditingBox.init(this); mapEditingBox.setKey(key); mapEditingBox.getEditingBoxTitle().setInnerText("Edit " + propertyName); keyPropertyMap.forEach((propertyKey, value) -> mapEditingBox.getKeyContainer().appendChild(propertyPresenter.getEditingPropertyFields("key", propertyKey, "")) ); valuePropertyMap.forEach((propertyKey, value) -> mapEditingBox.getValueContainer().appendChild(propertyPresenter.getEditingPropertyFields(VALUE, propertyKey, ""))); return mapEditingBox.getEditingBox(); }  @Override LIElement getEditingBox(String key, Map<String, String> keyPropertyMap, Map<String, String> valuePropertyMap); @Override void save();  }
@Test public void getEditingBox() { editingBoxMock = ((KeyValueEditingBoxPresenter)editingBoxPresenter).getEditingBox(TEST_KEY, TEST_KEY_PROPERTY_MAP, TEST_VALUE_PROPERTYY_MAP); verify(viewsProviderMock, times(1)).getKeyValueEditingBox(); verify(keyValueEditingBoxMock, times(1)).init((KeyValueEditingBoxPresenter)editingBoxPresenter); verify(keyValueEditingBoxMock, times(1)).setKey(TEST_KEY); verify(editingBoxTitleMock, times(1)).setInnerText("Edit " + TEST_PROPERTYNAME); verify(keyContainerMock, times(1)).appendChild(editingPropertyFieldsMock); verify(valueContainerMock, times(1)).appendChild(editingPropertyFieldsMock); verify(keyValueEditingBoxMock, times(1)).getEditingBox(); assertNotNull(editingBoxMock); }