@Test public void testAsKieAssetForPMMLIncludedModel() { final PMMLIncludedModel model = makePMMLIncludedModel(1, 2); final KieAssetsDropdownItem dropdownItem = itemsProvider.asKieAsset(model); assertEquals(model.getModelName(), dropdownItem.getText()); assertEquals(model.getModelPackage(), dropdownItem.getSubText()); assertEquals(model.getPath(), dropdownItem.getMetaData().get(PATH_METADATA)); assertEquals(model.getImportType(), dropdownItem.getMetaData().get(IMPORT_TYPE_METADATA)); assertEquals(model.getModelCount().toString(), dropdownItem.getMetaData().get(PMML_MODEL_COUNT_METADATA)); }
KieAssetsDropdownItem asKieAsset(final IncludedModel includedModel) { final String text = includedModel.getModelName(); final String subText = includedModel.getModelPackage(); final String value = getKieAssetValue(includedModel); final Map<String, String> metaData = buildMetaData(includedModel); return new KieAssetsDropdownItem(text, subText, value, metaData); }
DMNAssetsDropdownItemsProvider implements KieAssetsDropdownItemsProvider { KieAssetsDropdownItem asKieAsset(final IncludedModel includedModel) { final String text = includedModel.getModelName(); final String subText = includedModel.getModelPackage(); final String value = getKieAssetValue(includedModel); final Map<String, String> metaData = buildMetaData(includedModel); return new KieAssetsDropdownItem(text, subText, value, metaData); } }
DMNAssetsDropdownItemsProvider implements KieAssetsDropdownItemsProvider { KieAssetsDropdownItem asKieAsset(final IncludedModel includedModel) { final String text = includedModel.getModelName(); final String subText = includedModel.getModelPackage(); final String value = getKieAssetValue(includedModel); final Map<String, String> metaData = buildMetaData(includedModel); return new KieAssetsDropdownItem(text, subText, value, metaData); } @Inject  DMNAssetsDropdownItemsProvider(final DMNIncludeModelsClient client,
                                          final IncludedModelsPageState pageState,
                                          final IncludedModelsIndex modelsIndex,
                                          final SessionManager sessionManager); }
DMNAssetsDropdownItemsProvider implements KieAssetsDropdownItemsProvider { KieAssetsDropdownItem asKieAsset(final IncludedModel includedModel) { final String text = includedModel.getModelName(); final String subText = includedModel.getModelPackage(); final String value = getKieAssetValue(includedModel); final Map<String, String> metaData = buildMetaData(includedModel); return new KieAssetsDropdownItem(text, subText, value, metaData); } @Inject  DMNAssetsDropdownItemsProvider(final DMNIncludeModelsClient client,
                                          final IncludedModelsPageState pageState,
                                          final IncludedModelsIndex modelsIndex,
                                          final SessionManager sessionManager); @Override void getItems(final Consumer<List<KieAssetsDropdownItem>> assetListConsumer); }
DMNAssetsDropdownItemsProvider implements KieAssetsDropdownItemsProvider { KieAssetsDropdownItem asKieAsset(final IncludedModel includedModel) { final String text = includedModel.getModelName(); final String subText = includedModel.getModelPackage(); final String value = getKieAssetValue(includedModel); final Map<String, String> metaData = buildMetaData(includedModel); return new KieAssetsDropdownItem(text, subText, value, metaData); } @Inject  DMNAssetsDropdownItemsProvider(final DMNIncludeModelsClient client,
                                          final IncludedModelsPageState pageState,
                                          final IncludedModelsIndex modelsIndex,
                                          final SessionManager sessionManager); @Override void getItems(final Consumer<List<KieAssetsDropdownItem>> assetListConsumer); static final String PATH_METADATA; static final String IMPORT_TYPE_METADATA; static final String DRG_ELEMENT_COUNT_METADATA; static final String ITEM_DEFINITION_COUNT_METADATA; static final String PMML_MODEL_COUNT_METADATA; }