@Test public void getKeyValueContainer() { elementViewListLocal.clear(); LIElement keyValueContainer = elementPresenter.getKeyValueContainer(TEST_ITEM_ID, TEST_KEY_PROPERTY_MAP, TEST_VALUE_PROPERTYY_MAP); verify(elementView1Mock, times(1)).init(elementPresenter); verify(elementView1Mock, times(1)).setItemId(TEST_ITEM_ID); verify(elementView1Mock, times(1)).getKeyContainer(); verify(keyContainerMock, times(1)).appendChild(propertyFieldsMock); verify(elementView1Mock, times(1)).getValueContainer(); verify(valueContainerMock, times(1)).appendChild(propertyFieldsMock); assertNotNull(keyValueContainer); assertTrue(elementViewListLocal.contains(elementView1Mock)); }
@Override public LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues) { final KeyValueElementView keyValueElementView = viewsProvider.getKeyValueElementView(); keyValueElementView.init(this); keyValueElementView.setItemId(itemId); final UListElement keyContainer = keyValueElementView.getKeyContainer(); List<String> keyValueIds = getKeyValueIds(itemId); keyPropertiesValues.forEach((propertyName, propertyValue) -> keyContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(0), propertyName, propertyValue))); final UListElement valueContainer = keyValueElementView.getValueContainer(); valuePropertiesValues.forEach((propertyName, propertyValue) -> valueContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(1), propertyName, propertyValue))); elementViewList.add(keyValueElementView); return keyValueElementView.getItemContainer(); }
KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues) { final KeyValueElementView keyValueElementView = viewsProvider.getKeyValueElementView(); keyValueElementView.init(this); keyValueElementView.setItemId(itemId); final UListElement keyContainer = keyValueElementView.getKeyContainer(); List<String> keyValueIds = getKeyValueIds(itemId); keyPropertiesValues.forEach((propertyName, propertyValue) -> keyContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(0), propertyName, propertyValue))); final UListElement valueContainer = keyValueElementView.getValueContainer(); valuePropertiesValues.forEach((propertyName, propertyValue) -> valueContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(1), propertyName, propertyValue))); elementViewList.add(keyValueElementView); return keyValueElementView.getItemContainer(); } }
KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues) { final KeyValueElementView keyValueElementView = viewsProvider.getKeyValueElementView(); keyValueElementView.init(this); keyValueElementView.setItemId(itemId); final UListElement keyContainer = keyValueElementView.getKeyContainer(); List<String> keyValueIds = getKeyValueIds(itemId); keyPropertiesValues.forEach((propertyName, propertyValue) -> keyContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(0), propertyName, propertyValue))); final UListElement valueContainer = keyValueElementView.getValueContainer(); valuePropertiesValues.forEach((propertyName, propertyValue) -> valueContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(1), propertyName, propertyValue))); elementViewList.add(keyValueElementView); return keyValueElementView.getItemContainer(); }  }
KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues) { final KeyValueElementView keyValueElementView = viewsProvider.getKeyValueElementView(); keyValueElementView.init(this); keyValueElementView.setItemId(itemId); final UListElement keyContainer = keyValueElementView.getKeyContainer(); List<String> keyValueIds = getKeyValueIds(itemId); keyPropertiesValues.forEach((propertyName, propertyValue) -> keyContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(0), propertyName, propertyValue))); final UListElement valueContainer = keyValueElementView.getValueContainer(); valuePropertiesValues.forEach((propertyName, propertyValue) -> valueContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(1), propertyName, propertyValue))); elementViewList.add(keyValueElementView); return keyValueElementView.getItemContainer(); }  @Override LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues); @Override void onToggleRowExpansion(KeyValueElementView keyValueElementView, boolean isShown); @Override void onEditItem(KeyValueElementView keyValueElementView); @Override void onStopEditingItem(KeyValueElementView keyValueElementView); @Override void onDeleteItem(KeyValueElementView keyValueElementView); @Override void updateItem(KeyValueElementView keyValueElementView); @Override Map<Map<String, String>, Map<String, String>> getItemsProperties(); }
KeyValueElementPresenter extends ElementPresenter<KeyValueElementView> implements KeyValueElementView.Presenter { @Override public LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues) { final KeyValueElementView keyValueElementView = viewsProvider.getKeyValueElementView(); keyValueElementView.init(this); keyValueElementView.setItemId(itemId); final UListElement keyContainer = keyValueElementView.getKeyContainer(); List<String> keyValueIds = getKeyValueIds(itemId); keyPropertiesValues.forEach((propertyName, propertyValue) -> keyContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(0), propertyName, propertyValue))); final UListElement valueContainer = keyValueElementView.getValueContainer(); valuePropertiesValues.forEach((propertyName, propertyValue) -> valueContainer.appendChild(propertyPresenter.getPropertyFields(keyValueIds.get(1), propertyName, propertyValue))); elementViewList.add(keyValueElementView); return keyValueElementView.getItemContainer(); }  @Override LIElement getKeyValueContainer(String itemId, Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues); @Override void onToggleRowExpansion(KeyValueElementView keyValueElementView, boolean isShown); @Override void onEditItem(KeyValueElementView keyValueElementView); @Override void onStopEditingItem(KeyValueElementView keyValueElementView); @Override void onDeleteItem(KeyValueElementView keyValueElementView); @Override void updateItem(KeyValueElementView keyValueElementView); @Override Map<Map<String, String>, Map<String, String>> getItemsProperties();  }