target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testShow() { editor.bind(bound, 0, 0); editor.show(); verify(view).show(Optional.empty()); } | @Override public void show() { binding.ifPresent(b -> view.show(Optional.ofNullable(getPopoverTitle()))); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void show() { binding.ifPresent(b -> view.show(Optional.ofNullable(getPopoverTitle()))); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void show() { binding.ifPresent(b -> view.show(Optional.ofNullable(getPopoverTitle()))); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void show() { binding.ifPresent(b -> view.show(Optional.ofNullable(getPopoverTitle()))); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement ge... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void show() { binding.ifPresent(b -> view.show(Optional.ofNullable(getPopoverTitle()))); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement ge... |
@Test public void testHide() { editor.bind(bound, 0, 0); editor.hide(); verify(view).hide(); } | @Override public void hide() { binding.ifPresent(b -> view.hide()); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void hide() { binding.ifPresent(b -> view.hide()); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void hide() { binding.ifPresent(b -> view.hide()); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void hide() { binding.ifPresent(b -> view.hide()); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement getElement(); @Override String getPopove... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void hide() { binding.ifPresent(b -> view.hide()); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement getElement(); @Override String getPopove... |
@Test public void testBind() { editor.bind(bound, 0, 0); verify(view).setDMNModel(eq(decision)); verify(view).initValue(eq(NAME)); verify(view).initSelectedTypeRef(eq(typeRef)); editor.show(); verify(view).show(Optional.empty()); } | @Override public void bind(final HasValueAndTypeRef bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); refresh(); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void bind(final HasValueAndTypeRef bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); refresh(); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void bind(final HasValueAndTypeRef bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); refresh(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAnd... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void bind(final HasValueAndTypeRef bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); refresh(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAnd... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void bind(final HasValueAndTypeRef bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); refresh(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAnd... |
@Test public void testSetTypeRef() { editor.bind(bound, 0, 0); editor.setTypeRef(typeRef); verify(bound).setTypeRef(eq(typeRef)); } | @Override public void setTypeRef(final QName typeRef) { binding.ifPresent(b -> b.setTypeRef(typeRef)); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setTypeRef(final QName typeRef) { binding.ifPresent(b -> b.setTypeRef(typeRef)); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setTypeRef(final QName typeRef) { binding.ifPresent(b -> b.setTypeRef(typeRef)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setTypeRef(final QName typeRef) { binding.ifPresent(b -> b.setTypeRef(typeRef)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement getEl... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setTypeRef(final QName typeRef) { binding.ifPresent(b -> b.setTypeRef(typeRef)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView view); @Override HTMLElement getEl... |
@Test @SuppressWarnings("unchecked") public void testSetOnClosedByKeyboardCallback_WhenNotBound() { final Consumer callback = mock(Consumer.class); editor.setOnClosedByKeyboardCallback(callback); verify(view, never()).setOnClosedByKeyboardCallback(any(Consumer.class)); } | @Override public void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback) { binding.ifPresent(b -> view.setOnClosedByKeyboardCallback(callback)); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback) { binding.ifPresent(b -> view.setOnClosedByKeyboardCallback(callback)); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback) { binding.ifPresent(b -> view.setOnClosedByKeyboardCallback(callback)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback) { binding.ifPresent(b -> view.setOnClosedByKeyboardCallback(callback)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback) { binding.ifPresent(b -> view.setOnClosedByKeyboardCallback(callback)); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl... |
@Test public void testGetValueLabel_WhenNotBound() { final Throwable thrown = catchThrowable(() -> editor.getValueLabel()); assertThat(thrown).isInstanceOf(IllegalStateException.class) .hasMessageContaining(BINDING_EXCEPTION); } | @Override public String getValueLabel() { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).getValueLabel(); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String getValueLabel() { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).getValueLabel(); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String getValueLabel() { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).getValueLabel(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String getValueLabel() { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).getValueLabel(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String getValueLabel() { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).getValueLabel(); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final ValueAndDataTypePopoverView... |
@Test public void testNormaliseValue_WhenNotBound() { final Throwable thrown = catchThrowable(() -> editor.normaliseValue(NAME)); assertThat(thrown).isInstanceOf(IllegalStateException.class) .hasMessageContaining(BINDING_EXCEPTION); } | @Override public String normaliseValue(final String value) { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).normaliseValue(value); } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String normaliseValue(final String value) { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).normaliseValue(value); } } | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String normaliseValue(final String value) { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).normaliseValue(value); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final Va... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String normaliseValue(final String value) { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).normaliseValue(value); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final Va... | ValueAndDataTypePopoverImpl implements ValueAndDataTypePopoverView.Presenter { @Override public String normaliseValue(final String value) { return binding.orElseThrow(() -> new IllegalStateException(BINDING_EXCEPTION)).normaliseValue(value); } ValueAndDataTypePopoverImpl(); @Inject ValueAndDataTypePopoverImpl(final Va... |
@Test public void testIsValid() { final DataType dataType = mock(DataType.class); doReturn(false).when(validator).isBlank(dataType); doReturn(false).when(validator).isNotUnique(dataType); doReturn(false).when(validator).isDefault(dataType); final boolean isValid = validator.isValid(dataType); verify(flashMessageEvent, ... | public boolean isValid(final DataType dataType) { if (isBlank(dataType)) { flashMessageEvent.fire(blankErrorMessage.getFlashMessage(dataType)); return false; } if (isNotUnique(dataType)) { flashMessageEvent.fire(notUniqueErrorMessage.getFlashMessage(dataType)); return false; } if (isDefault(dataType)) { flashMessageEve... | DataTypeNameValidator { public boolean isValid(final DataType dataType) { if (isBlank(dataType)) { flashMessageEvent.fire(blankErrorMessage.getFlashMessage(dataType)); return false; } if (isNotUnique(dataType)) { flashMessageEvent.fire(notUniqueErrorMessage.getFlashMessage(dataType)); return false; } if (isDefault(data... | DataTypeNameValidator { public boolean isValid(final DataType dataType) { if (isBlank(dataType)) { flashMessageEvent.fire(blankErrorMessage.getFlashMessage(dataType)); return false; } if (isNotUnique(dataType)) { flashMessageEvent.fire(notUniqueErrorMessage.getFlashMessage(dataType)); return false; } if (isDefault(data... | DataTypeNameValidator { public boolean isValid(final DataType dataType) { if (isBlank(dataType)) { flashMessageEvent.fire(blankErrorMessage.getFlashMessage(dataType)); return false; } if (isNotUnique(dataType)) { flashMessageEvent.fire(notUniqueErrorMessage.getFlashMessage(dataType)); return false; } if (isDefault(data... | DataTypeNameValidator { public boolean isValid(final DataType dataType) { if (isBlank(dataType)) { flashMessageEvent.fire(blankErrorMessage.getFlashMessage(dataType)); return false; } if (isNotUnique(dataType)) { flashMessageEvent.fire(notUniqueErrorMessage.getFlashMessage(dataType)); return false; } if (isDefault(data... |
@Test public void testIsNotBlankWhenNameIsBlank() { final DataType dataType = makeDataType("uuid", ""); assertTrue(validator.isBlank(dataType)); } | boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... |
@Test public void testDMNFromWBWithNullValue() { assertNull(ExpressionLanguagePropertyConverter.dmnFromWB(new ExpressionLanguage(null))); } | public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... |
@Test public void testIsNotBlankWhenNameIsNull() { final DataType dataType = makeDataType("uuid", null); assertTrue(validator.isBlank(dataType)); } | boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... |
@Test public void testIsNotBlankWhenNameIsNotBlank() { final DataType dataType = makeDataType("uuid", "tCity"); assertFalse(validator.isBlank(dataType)); } | boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } } | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... | DataTypeNameValidator { boolean isBlank(final DataType dataType) { return isEmpty(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
final DataTypeNa... |
@Test public void testIsDefaultWhenItReturnsTrue() { final DataType dataType = mock(DataType.class); when(dataType.getName()).thenReturn("string"); assertTrue(validator.isDefault(dataType)); } | boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } } | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... |
@Test public void testIsDefaultWhenItReturnsFalse() { final DataType dataType = mock(DataType.class); when(dataType.getName()).thenReturn("tCity"); assertFalse(validator.isDefault(dataType)); } | boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } } | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... | DataTypeNameValidator { boolean isDefault(final DataType dataType) { return BuiltInTypeUtils.isBuiltInType(dataType.getName()); } @Inject DataTypeNameValidator(final Event<FlashMessage> flashMessageEvent,
final DataTypeNameIsBlankErrorMessage blankErrorMessage,
... |
@Test public void testSiblingsWhenDataTypeDoesNotHaveParent() { final DataType dataType = mock(DataType.class); final List<DataType> expectedSiblings = Collections.singletonList(mock(DataType.class)); when(dataTypeStore.getTopLevelDataTypes()).thenReturn(expectedSiblings); final List<DataType> actualSiblings = validato... | public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } } | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... |
@Test public void testSiblingsWhenDataTypeHasParent() { final DataType dataType = mock(DataType.class); final DataType parent = mock(DataType.class); final String parentUUID = "parentUUID"; final List<DataType> expectedSiblings = Collections.singletonList(mock(DataType.class)); when(dataType.getParentUUID()).thenReturn... | public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } } | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... | DataTypeNameValidator { public List<DataType> siblings(final DataType dataType) { final Optional<DataType> parent = Optional.ofNullable(dataTypeStore.get(dataType.getParentUUID())); if (parent.isPresent()) { return parent.get().getSubDataTypes(); } else { return dataTypeStore.getTopLevelDataTypes(); } } @Inject DataTy... |
@Test public void testGetWhenItReturnsNull() { assertNull(store.get("456")); } | public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } |
@Test public void testGetWhenItDoesNotReturnNull() { assertNotNull(store.get(uuid)); assertEquals(itemDefinition, store.get(uuid)); } | public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } | ItemDefinitionStore { public ItemDefinition get(final String uuid) { return itemDefinitions.get(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } |
@Test public void testIndex() { final ItemDefinition itemDefinition = mock(ItemDefinition.class); final String uuid = "789"; store.index(uuid, itemDefinition); assertEquals(itemDefinition, store.get(uuid)); } | public void index(final String uuid, final ItemDefinition itemDefinition) { itemDefinitions.put(uuid, itemDefinition); } | ItemDefinitionStore { public void index(final String uuid, final ItemDefinition itemDefinition) { itemDefinitions.put(uuid, itemDefinition); } } | ItemDefinitionStore { public void index(final String uuid, final ItemDefinition itemDefinition) { itemDefinitions.put(uuid, itemDefinition); } } | ItemDefinitionStore { public void index(final String uuid, final ItemDefinition itemDefinition) { itemDefinitions.put(uuid, itemDefinition); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); ... | ItemDefinitionStore { public void index(final String uuid, final ItemDefinition itemDefinition) { itemDefinitions.put(uuid, itemDefinition); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); ... |
@Test public void testClear() { store.clear(); assertEquals(0, store.size()); } | public void clear() { itemDefinitions.clear(); } | ItemDefinitionStore { public void clear() { itemDefinitions.clear(); } } | ItemDefinitionStore { public void clear() { itemDefinitions.clear(); } } | ItemDefinitionStore { public void clear() { itemDefinitions.clear(); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } | ItemDefinitionStore { public void clear() { itemDefinitions.clear(); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } |
@Test public void testDMNFromWBWithEmptyValue() { assertNull(ExpressionLanguagePropertyConverter.dmnFromWB(new ExpressionLanguage())); } | public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... |
@Test public void testUnIndex() { store.unIndex(uuid); assertNull(store.get(uuid)); } | public void unIndex(final String uuid) { itemDefinitions.remove(uuid); } | ItemDefinitionStore { public void unIndex(final String uuid) { itemDefinitions.remove(uuid); } } | ItemDefinitionStore { public void unIndex(final String uuid) { itemDefinitions.remove(uuid); } } | ItemDefinitionStore { public void unIndex(final String uuid) { itemDefinitions.remove(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } | ItemDefinitionStore { public void unIndex(final String uuid) { itemDefinitions.remove(uuid); } ItemDefinition get(final String uuid); void index(final String uuid,
final ItemDefinition itemDefinition); void clear(); void unIndex(final String uuid); } |
@Test public void testMakeName() { final DataType dataType = mock(DataType.class); final String expectedName = "name"; when(dataType.getName()).thenReturn(expectedName); final Name name = handler.makeName(dataType); assertEquals(expectedName, name.getValue()); } | Name makeName(final DataType dataType) { return new Name(dataType.getName()); } | ItemDefinitionUpdateHandler { Name makeName(final DataType dataType) { return new Name(dataType.getName()); } } | ItemDefinitionUpdateHandler { Name makeName(final DataType dataType) { return new Name(dataType.getName()); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
final Pro... | ItemDefinitionUpdateHandler { Name makeName(final DataType dataType) { return new Name(dataType.getName()); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
final Pro... | ItemDefinitionUpdateHandler { Name makeName(final DataType dataType) { return new Name(dataType.getName()); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
final Pro... |
@Test public void testMakeQNameWhenDataTypeIsDefault() { final DataType dataType = mock(DataType.class); final String expectedName = "string"; when(dataType.getType()).thenReturn(expectedName); final QName name = handler.makeQName(dataType); final String actualName = name.getLocalPart(); assertEquals(expectedName, actu... | QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... |
@Test public void testMakeQNameWhenDataTypeIsNotDefault() { final DataType dataType = mock(DataType.class); final String expectedName = "tAddress"; when(dataType.getType()).thenReturn(expectedName); final QName name = handler.makeQName(dataType); final String actual = name.toString(); final String expected = "tAddress"... | QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... |
@Test public void testMakeQNameWithItemDefinition() { final ItemDefinition itemDefinition = mock(ItemDefinition.class); final Name itemDefinitionName = mock(Name.class); final String expectedName = "tAddress"; when(itemDefinitionName.getValue()).thenReturn(expectedName); when(itemDefinition.getName()).thenReturn(itemDe... | QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } } | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionUpdateHandler { QName makeQName(final DataType dataType) { return normaliseTypeRef(makeQName(dataType.getType())); } @Inject ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
final ItemDefinitionUtils itemDefinitionUtils,
... |
@Test public void testMakeAllowedValuesWhenDataTypeConstraintIsBlank() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(dataType.getConstraint()).thenReturn(""); final UnaryTests actualAllowedValues = handler.makeAllowedValues(dataType, itemDefinit... | UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), ... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... |
@Test public void testMakeAllowedValuesWhenDataTypeConstraintIsNull() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(dataType.getConstraint()).thenReturn(null); when(dataType.getConstraintType()).thenReturn(null); final UnaryTests actualAllowedVa... | UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), ... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... | ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Descrip... |
@Test public void testDestroy() { final String uuid = "uuid"; final String oldItemDefinitionName = "oldItemDefinitionName"; final DataType dataType = mock(DataType.class); final Name name = mock(Name.class); final ItemDefinition itemDefinition = makeItemDefinition(); final ItemDefinition itemDefinitionParent = makeItem... | public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) { final ItemDefinition itemDefinition = findItemDefinition(dataType); final String destroyedItemDefinition = itemDefinition.getName().getValue(); final Optional<ItemDefinition> itemDefinitionParent = findItemDefinitionParent(dataType); it... | ItemDefinitionDestroyHandler { public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) { final ItemDefinition itemDefinition = findItemDefinition(dataType); final String destroyedItemDefinition = itemDefinition.getName().getValue(); final Optional<ItemDefinition> itemDefinitionParent = findIte... | ItemDefinitionDestroyHandler { public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) { final ItemDefinition itemDefinition = findItemDefinition(dataType); final String destroyedItemDefinition = itemDefinition.getName().getValue(); final Optional<ItemDefinition> itemDefinitionParent = findIte... | ItemDefinitionDestroyHandler { public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) { final ItemDefinition itemDefinition = findItemDefinition(dataType); final String destroyedItemDefinition = itemDefinition.getName().getValue(); final Optional<ItemDefinition> itemDefinitionParent = findIte... | ItemDefinitionDestroyHandler { public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) { final ItemDefinition itemDefinition = findItemDefinition(dataType); final String destroyedItemDefinition = itemDefinition.getName().getValue(); final Optional<ItemDefinition> itemDefinitionParent = findIte... |
@Test public void testNotifyPropertiesPanel() { final String destroyedItemDefinition = "destroyedItemDefinition"; when(panelNotifier.withOldLocalPart(destroyedItemDefinition)).thenReturn(panelNotifier); when(panelNotifier.withNewQName(eq(new QName()))).thenReturn(panelNotifier); handler.notifyPropertiesPanel(destroyedI... | void notifyPropertiesPanel(final String destroyedItemDefinition) { panelNotifier .withOldLocalPart(destroyedItemDefinition) .withNewQName(new QName()) .notifyPanel(); } | ItemDefinitionDestroyHandler { void notifyPropertiesPanel(final String destroyedItemDefinition) { panelNotifier .withOldLocalPart(destroyedItemDefinition) .withNewQName(new QName()) .notifyPanel(); } } | ItemDefinitionDestroyHandler { void notifyPropertiesPanel(final String destroyedItemDefinition) { panelNotifier .withOldLocalPart(destroyedItemDefinition) .withNewQName(new QName()) .notifyPanel(); } @Inject ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionDestroyHandler { void notifyPropertiesPanel(final String destroyedItemDefinition) { panelNotifier .withOldLocalPart(destroyedItemDefinition) .withNewQName(new QName()) .notifyPanel(); } @Inject ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionDestroyHandler { void notifyPropertiesPanel(final String destroyedItemDefinition) { panelNotifier .withOldLocalPart(destroyedItemDefinition) .withNewQName(new QName()) .notifyPanel(); } @Inject ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testFindItemDefinitionParentWhenParentDoesNotExist() { final DataType dataType = mock(DataType.class); final String parentUUID = "parentUUID"; when(dataType.getParentUUID()).thenReturn(parentUUID); when(itemDefinitionStore.get(parentUUID)).thenReturn(null); final Optional<ItemDefinition> expectedParen... | Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionParent.get(); if (parent.getTypeR... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... |
@Test public void testDMNFromWBWithNonNullValue() { assertEquals(EXPRESSION_LANGUAGE, ExpressionLanguagePropertyConverter.dmnFromWB(new ExpressionLanguage(EXPRESSION_LANGUAGE))); } | public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } } | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... | ExpressionLanguagePropertyConverter { public static String dmnFromWB(final ExpressionLanguage language) { if (language == null) { return null; } else if (StringUtils.isEmpty(language.getValue())) { return null; } else { return language.getValue(); } } static ExpressionLanguage wbFromDMN(final String language); static ... |
@Test public void testFindItemDefinitionParentWhenParentDoesNotHaveTypeRef() { final DataType dataType = mock(DataType.class); final ItemDefinition parent = makeItemDefinition(); final String parentUUID = "parentUUID"; when(parent.getTypeRef()).thenReturn(null); when(dataType.getParentUUID()).thenReturn(parentUUID); wh... | Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionParent.get(); if (parent.getTypeR... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... | ItemDefinitionDestroyHandler { Optional<ItemDefinition> findItemDefinitionParent(final DataType dataType) { final Optional<ItemDefinition> itemDefinitionParent = Optional.ofNullable(itemDefinitionStore.get(dataType.getParentUUID())); if (itemDefinitionParent.isPresent()) { final ItemDefinition parent = itemDefinitionPa... |
@Test public void testItemDefinitions() { final Definitions definitions = mock(Definitions.class); final ItemDefinition itemDefinition = makeItemDefinition(); final List<ItemDefinition> expectedItemDefinitions = singletonList(itemDefinition); when(dmnGraphUtils.getModelDefinitions()).thenReturn(definitions); when(defin... | List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } } | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... |
@Test public void testItemDefinitionsWhenDefinitionsIsNull() { final List<ItemDefinition> expectedItemDefinitions = emptyList(); when(dmnGraphUtils.getModelDefinitions()).thenReturn(null); final List<ItemDefinition> actualItemDefinitions = handler.itemDefinitions(); assertEquals(expectedItemDefinitions, actualItemDefin... | List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } } | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... | ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject ItemDefinitionDestroyHandler(fin... |
@Test public void testAppend() { final DataType dataType = mock(DataType.class); final DataType dataTypeWithoutName = mock(DataType.class); final DataType updatedDataType = mock(DataType.class); final DataTypeManager withDataType = mock(DataTypeManager.class); final DataTypeManager withNoName = mock(DataTypeManager.cla... | public List<DataType> append(final DataType dataType, final ItemDefinition itemDefinition) { final DataType named; if (Strings.isNullOrEmpty(dataType.getName())) { named = withNoName(dataType); } else { named = dataType; } final DataType updateDataType = updateDataTypeProperties(named, TOP_LEVEL_PARENT_UUID, itemDefini... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> append(final DataType dataType, final ItemDefinition itemDefinition) { final DataType named; if (Strings.isNullOrEmpty(dataType.getName())) { named = withNoName(dataType); } else { named = dataType; } final DataType updateDataType = updateDataTypePro... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> append(final DataType dataType, final ItemDefinition itemDefinition) { final DataType named; if (Strings.isNullOrEmpty(dataType.getName())) { named = withNoName(dataType); } else { named = dataType; } final DataType updateDataType = updateDataTypePro... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> append(final DataType dataType, final ItemDefinition itemDefinition) { final DataType named; if (Strings.isNullOrEmpty(dataType.getName())) { named = withNoName(dataType); } else { named = dataType; } final DataType updateDataType = updateDataTypePro... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> append(final DataType dataType, final ItemDefinition itemDefinition) { final DataType named; if (Strings.isNullOrEmpty(dataType.getName())) { named = withNoName(dataType); } else { named = dataType; } final DataType updateDataType = updateDataTypePro... |
@Test public void testInsertNotNested() { final DataType dataType = mock(DataType.class); final DataType reference = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); final List<DataType> expectedAffectedDataTypes = asList(mock(DataType.class), mock(DataType.class)); final Creation... | public List<DataType> insertSibling(final DataType dataType, final DataType reference, final CreationType creationType, final ItemDefinition itemDefinition) { final Optional<DataType> parentOptional = lookupAbsoluteParent(reference); if (parentOptional.isPresent()) { final DataType parent = parentOptional.get(); final ... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> insertSibling(final DataType dataType, final DataType reference, final CreationType creationType, final ItemDefinition itemDefinition) { final Optional<DataType> parentOptional = lookupAbsoluteParent(reference); if (parentOptional.isPresent()) { fina... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> insertSibling(final DataType dataType, final DataType reference, final CreationType creationType, final ItemDefinition itemDefinition) { final Optional<DataType> parentOptional = lookupAbsoluteParent(reference); if (parentOptional.isPresent()) { fina... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> insertSibling(final DataType dataType, final DataType reference, final CreationType creationType, final ItemDefinition itemDefinition) { final Optional<DataType> parentOptional = lookupAbsoluteParent(reference); if (parentOptional.isPresent()) { fina... | DataTypeCreateHandler extends DataTypeHandler { public List<DataType> insertSibling(final DataType dataType, final DataType reference, final CreationType creationType, final ItemDefinition itemDefinition) { final Optional<DataType> parentOptional = lookupAbsoluteParent(reference); if (parentOptional.isPresent()) { fina... |
@Test public void testLookupAbsoluteParentWhenReferenceDoesNotHaveParent() { final DataType reference = mock(DataType.class); final String parentUUID = "parentUUID"; when(reference.getParentUUID()).thenReturn(parentUUID); when(dataTypeStore.get(parentUUID)).thenReturn(null); final Optional<DataType> absoluteParent = ha... | Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... |
@Test public void testLookupAbsoluteParentWhenReferenceTypeIsStructure() { final DataType reference = mock(DataType.class); final DataType expectedParent = mock(DataType.class); final String parentUUID = "parentUUID"; final String structure = "Structure"; when(reference.getParentUUID()).thenReturn(parentUUID); when(exp... | Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... |
@Test public void testLookupAbsoluteParentWhenReferenceTypeIsNotStructure() { final DataType reference = mock(DataType.class); final DataType expectedParent = mock(DataType.class); final DataType tCityTopLevel = mock(DataType.class); final String parentUUID = "parentUUID"; final String structure = "Structure"; final St... | Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } } | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... | DataTypeCreateHandler extends DataTypeHandler { Optional<DataType> lookupAbsoluteParent(final DataType reference) { final Optional<DataType> optionalParent = Optional.ofNullable(parent(reference)); if (optionalParent.isPresent()) { return fetchTopLevelDataType(optionalParent.get()); } return Optional.empty(); } @Inject... |
@Test public void testUpdateDataType() { final String parentUUID = "parentUUID"; final DataType dataType = mock(DataType.class); final DataType expectedUpdateDataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); final DataTypeManager dataTypeManagerWithDataType = mock(DataTy... | DataType updateDataTypeProperties(final DataType dataType, final String newParentUUID, final ItemDefinition newItemDefinition) { return dataTypeManager .withDataType(dataType) .withParentUUID(newParentUUID) .withItemDefinition(newItemDefinition) .withIndexedItemDefinition() .withItemDefinitionSubDataTypes() .withUnique... | DataTypeCreateHandler extends DataTypeHandler { DataType updateDataTypeProperties(final DataType dataType, final String newParentUUID, final ItemDefinition newItemDefinition) { return dataTypeManager .withDataType(dataType) .withParentUUID(newParentUUID) .withItemDefinition(newItemDefinition) .withIndexedItemDefinition... | DataTypeCreateHandler extends DataTypeHandler { DataType updateDataTypeProperties(final DataType dataType, final String newParentUUID, final ItemDefinition newItemDefinition) { return dataTypeManager .withDataType(dataType) .withParentUUID(newParentUUID) .withItemDefinition(newItemDefinition) .withIndexedItemDefinition... | DataTypeCreateHandler extends DataTypeHandler { DataType updateDataTypeProperties(final DataType dataType, final String newParentUUID, final ItemDefinition newItemDefinition) { return dataTypeManager .withDataType(dataType) .withParentUUID(newParentUUID) .withItemDefinition(newItemDefinition) .withIndexedItemDefinition... | DataTypeCreateHandler extends DataTypeHandler { DataType updateDataTypeProperties(final DataType dataType, final String newParentUUID, final ItemDefinition newItemDefinition) { return dataTypeManager .withDataType(dataType) .withParentUUID(newParentUUID) .withItemDefinition(newItemDefinition) .withIndexedItemDefinition... |
@Test public void testInit() { final ItemDefinitionRecordEngine expectedRecordEngine = mock(ItemDefinitionRecordEngine.class); handler.init(expectedRecordEngine); final ItemDefinitionRecordEngine actualRecordEngine = handler.getRecordEngine(); assertEquals(expectedRecordEngine, actualRecordEngine); } | public void init(final ItemDefinitionRecordEngine recordEngine) { this.recordEngine = recordEngine; } | DataTypeHandler { public void init(final ItemDefinitionRecordEngine recordEngine) { this.recordEngine = recordEngine; } } | DataTypeHandler { public void init(final ItemDefinitionRecordEngine recordEngine) { this.recordEngine = recordEngine; } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { public void init(final ItemDefinitionRecordEngine recordEngine) { this.recordEngine = recordEngine; } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } | DataTypeHandler { public void init(final ItemDefinitionRecordEngine recordEngine) { this.recordEngine = recordEngine; } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } |
@Test public void testWbFromDMN() { final org.kie.dmn.model.api.ItemDefinition itemDefinition = new TItemDefinition(); final org.kie.dmn.model.api.ItemDefinition itemComponent1 = new TItemDefinition(); final org.kie.dmn.model.api.ItemDefinition itemComponent2 = new TItemDefinition(); final org.kie.dmn.model.api.ItemDef... | public static ItemDefinition wbFromDMN(final org.kie.dmn.model.api.ItemDefinition dmnItemDefinition, final String prefix) { final org.kie.dmn.model.api.ItemDefinition dmnItemDefinitionWithNamespace = withNamespace(dmnItemDefinition, prefix); final ItemDefinition wbItemDefinition = ItemDefinitionPropertyConverter.wbFrom... | ImportedItemDefinitionConverter { public static ItemDefinition wbFromDMN(final org.kie.dmn.model.api.ItemDefinition dmnItemDefinition, final String prefix) { final org.kie.dmn.model.api.ItemDefinition dmnItemDefinitionWithNamespace = withNamespace(dmnItemDefinition, prefix); final ItemDefinition wbItemDefinition = Item... | ImportedItemDefinitionConverter { public static ItemDefinition wbFromDMN(final org.kie.dmn.model.api.ItemDefinition dmnItemDefinition, final String prefix) { final org.kie.dmn.model.api.ItemDefinition dmnItemDefinitionWithNamespace = withNamespace(dmnItemDefinition, prefix); final ItemDefinition wbItemDefinition = Item... | ImportedItemDefinitionConverter { public static ItemDefinition wbFromDMN(final org.kie.dmn.model.api.ItemDefinition dmnItemDefinition, final String prefix) { final org.kie.dmn.model.api.ItemDefinition dmnItemDefinitionWithNamespace = withNamespace(dmnItemDefinition, prefix); final ItemDefinition wbItemDefinition = Item... | ImportedItemDefinitionConverter { public static ItemDefinition wbFromDMN(final org.kie.dmn.model.api.ItemDefinition dmnItemDefinition, final String prefix) { final org.kie.dmn.model.api.ItemDefinition dmnItemDefinitionWithNamespace = withNamespace(dmnItemDefinition, prefix); final ItemDefinition wbItemDefinition = Item... |
@Test public void testGetPMMLDocumentsPathsWhenWorkspaceProjectIsNull() { doTestGetPathsWhenWorkspaceProjectIsNull(workspaceProject1 -> pathsHelper.getPMMLModelsPaths(null)); } | @Override public List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject) { if (workspaceProject != null) { return getPathsByWorkspaceProject(pmmlQueryTerms(workspaceProject.getRootPath().toURI())); } else { return getStandalonePaths(pmmlDocumentFilter()); } } | DMNPathsHelperImpl implements DMNPathsHelper { @Override public List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject) { if (workspaceProject != null) { return getPathsByWorkspaceProject(pmmlQueryTerms(workspaceProject.getRootPath().toURI())); } else { return getStandalonePaths(pmmlDocumentFilter()); } ... | DMNPathsHelperImpl implements DMNPathsHelper { @Override public List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject) { if (workspaceProject != null) { return getPathsByWorkspaceProject(pmmlQueryTerms(workspaceProject.getRootPath().toURI())); } else { return getStandalonePaths(pmmlDocumentFilter()); } ... | DMNPathsHelperImpl implements DMNPathsHelper { @Override public List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject) { if (workspaceProject != null) { return getPathsByWorkspaceProject(pmmlQueryTerms(workspaceProject.getRootPath().toURI())); } else { return getStandalonePaths(pmmlDocumentFilter()); } ... | DMNPathsHelperImpl implements DMNPathsHelper { @Override public List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject) { if (workspaceProject != null) { return getPathsByWorkspaceProject(pmmlQueryTerms(workspaceProject.getRootPath().toURI())); } else { return getStandalonePaths(pmmlDocumentFilter()); } ... |
@Test public void testGetClosestTopLevelDataType() { final DataType dataType0 = makeDataType("name", "Text", false); final DataType dataType1 = makeDataType("name", "Text", false); final DataType dataType2 = makeDataType("name", "Text", false); final DataType dataType3 = makeDataType("city", "tCity", false); final Data... | Optional<DataType> getClosestTopLevelDataType(final DataType dataType) { final Optional<DataType> closestTopLevelDataType = getClosestTopLevel(parent(dataType)); if (closestTopLevelDataType.isPresent()) { final DataType topLevel = closestTopLevelDataType.get(); final String type = topLevel.isTopLevel() ? topLevel.getNa... | DataTypeHandler { Optional<DataType> getClosestTopLevelDataType(final DataType dataType) { final Optional<DataType> closestTopLevelDataType = getClosestTopLevel(parent(dataType)); if (closestTopLevelDataType.isPresent()) { final DataType topLevel = closestTopLevelDataType.get(); final String type = topLevel.isTopLevel(... | DataTypeHandler { Optional<DataType> getClosestTopLevelDataType(final DataType dataType) { final Optional<DataType> closestTopLevelDataType = getClosestTopLevel(parent(dataType)); if (closestTopLevelDataType.isPresent()) { final DataType topLevel = closestTopLevelDataType.get(); final String type = topLevel.isTopLevel(... | DataTypeHandler { Optional<DataType> getClosestTopLevelDataType(final DataType dataType) { final Optional<DataType> closestTopLevelDataType = getClosestTopLevel(parent(dataType)); if (closestTopLevelDataType.isPresent()) { final DataType topLevel = closestTopLevelDataType.get(); final String type = topLevel.isTopLevel(... | DataTypeHandler { Optional<DataType> getClosestTopLevelDataType(final DataType dataType) { final Optional<DataType> closestTopLevelDataType = getClosestTopLevel(parent(dataType)); if (closestTopLevelDataType.isPresent()) { final DataType topLevel = closestTopLevelDataType.get(); final String type = topLevel.isTopLevel(... |
@Test public void testGetSubDataTypesByType() { final String type = "tCity"; final DataType dataType0 = makeDataType("tPerson", "Structure"); final DataType dataType1 = makeDataType("tCity", "Structure"); final DataType dataType2 = makeDataType("city1", "tCity"); final DataType dataType3 = makeDataType("city2", "tCity"... | List<DataType> getSubDataTypesByType(final String type) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).collect(); } | DataTypeHandler { List<DataType> getSubDataTypesByType(final String type) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).collect(); } } | DataTypeHandler { List<DataType> getSubDataTypesByType(final String type) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { List<DataType> getSubDataTypesByType(final String type) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRec... | DataTypeHandler { List<DataType> getSubDataTypesByType(final String type) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRec... |
@Test public void testForEachSubDataTypesByType() { final String type = "tCity"; final DataType dataType0 = makeDataType("tPerson", "Structure"); final DataType dataType1 = makeDataType("tCity", "Structure"); final DataType dataType2 = makeDataType("city1", "tCity"); final DataType dataType3 = makeDataType("city2", "tC... | List<DataType> forEachSubDataTypesByType(final String type, final Consumer<DataType> consumer) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).apply(consumer).collect(); } | DataTypeHandler { List<DataType> forEachSubDataTypesByType(final String type, final Consumer<DataType> consumer) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).apply(consumer).collect(); } } | DataTypeHandler { List<DataType> forEachSubDataTypesByType(final String type, final Consumer<DataType> consumer) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).apply(consumer).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeMana... | DataTypeHandler { List<DataType> forEachSubDataTypesByType(final String type, final Consumer<DataType> consumer) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).apply(consumer).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeMana... | DataTypeHandler { List<DataType> forEachSubDataTypesByType(final String type, final Consumer<DataType> consumer) { return new DataTypeQuery().where(dataType -> Objects.equals(dataType.getType(), type)).apply(consumer).collect(); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeMana... |
@Test public void testForEachSubDataTypesByTypeOrName() { final String type = "tCompany"; final DataType dataType0 = makeDataType("RedHat", "tCompany"); final DataType dataType1 = makeDataType("tPerson", "Structure"); final DataType dataType2 = makeDataType("tCity", "Structure"); final DataType dataType3 = makeDataType... | List<DataType> forEachSubDataTypesByTypeOrName(final String typeOrName, final Consumer<DataType> consumer) { return new DataTypeQuery() .where(dataType -> Objects.equals(dataType.getType(), typeOrName) || Objects.equals(dataType.getName(), typeOrName)) .apply(consumer) .collect(); } | DataTypeHandler { List<DataType> forEachSubDataTypesByTypeOrName(final String typeOrName, final Consumer<DataType> consumer) { return new DataTypeQuery() .where(dataType -> Objects.equals(dataType.getType(), typeOrName) || Objects.equals(dataType.getName(), typeOrName)) .apply(consumer) .collect(); } } | DataTypeHandler { List<DataType> forEachSubDataTypesByTypeOrName(final String typeOrName, final Consumer<DataType> consumer) { return new DataTypeQuery() .where(dataType -> Objects.equals(dataType.getType(), typeOrName) || Objects.equals(dataType.getName(), typeOrName)) .apply(consumer) .collect(); } DataTypeHandler(fi... | DataTypeHandler { List<DataType> forEachSubDataTypesByTypeOrName(final String typeOrName, final Consumer<DataType> consumer) { return new DataTypeQuery() .where(dataType -> Objects.equals(dataType.getType(), typeOrName) || Objects.equals(dataType.getName(), typeOrName)) .apply(consumer) .collect(); } DataTypeHandler(fi... | DataTypeHandler { List<DataType> forEachSubDataTypesByTypeOrName(final String typeOrName, final Consumer<DataType> consumer) { return new DataTypeQuery() .where(dataType -> Objects.equals(dataType.getType(), typeOrName) || Objects.equals(dataType.getName(), typeOrName)) .apply(consumer) .collect(); } DataTypeHandler(fi... |
@Test public void testRefreshSubDataTypes() { final DataTypeManager dataTypeManagerWithDataType = mock(DataTypeManager.class); final DataType dataType = makeDataType(); final String type = "type"; doNothing().when(handler).refreshSubDataTypes(any(), anyString()); when(dataTypeManager.withDataType(dataType)).thenReturn(... | void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefini... | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefini... |
@Test public void testRefreshSubDataTypesWithNewType() { final DataType dataType = makeDataType(); final String newType = "newType"; when(dataTypeManager.from(any(DataType.class))).thenReturn(dataTypeManager); when(dataTypeManager.withRefreshedSubDataTypes(anyString())).thenReturn(dataTypeManager); handler.refreshSubDa... | void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefini... | DataTypeHandler { void refreshSubDataTypes(final DataType dataType) { final String type = dataTypeManager.withDataType(dataType).getTypeName(); refreshSubDataTypes(dataType, type); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefini... |
@Test public void testParent() { final DataType dataType = makeDataType(); final DataType expectedParent = makeDataType(); final String parentUUID = "parentUUID"; when(dataType.getParentUUID()).thenReturn(parentUUID); when(dataTypeStore.get(parentUUID)).thenReturn(expectedParent); final DataType actualParent = handler.... | DataType parent(final DataType dataType) { return dataTypeStore.get(dataType.getParentUUID()); } | DataTypeHandler { DataType parent(final DataType dataType) { return dataTypeStore.get(dataType.getParentUUID()); } } | DataTypeHandler { DataType parent(final DataType dataType) { return dataTypeStore.get(dataType.getParentUUID()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { DataType parent(final DataType dataType) { return dataTypeStore.get(dataType.getParentUUID()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } | DataTypeHandler { DataType parent(final DataType dataType) { return dataTypeStore.get(dataType.getParentUUID()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } |
@Test public void testIsStructureWhenItReturnsTrue() { final DataType dataType = mock(DataType.class); final String structure = "Structure"; when(dataTypeManager.structure()).thenReturn(structure); when(dataType.getType()).thenReturn(structure); assertTrue(handler.isStructure(dataType)); } | boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } |
@Test public void testIsStructureWhenItReturnsFalse() { final DataType dataType = mock(DataType.class); when(dataTypeManager.structure()).thenReturn("Structure"); when(dataType.getType()).thenReturn("tCity"); assertFalse(handler.isStructure(dataType)); } | boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } | DataTypeHandler { boolean isStructure(final DataType dataType) { return Objects.equals(dataType.getType(), dataTypeManager.structure()); } DataTypeHandler(final DataTypeStore dataTypeStore,
final DataTypeManager dataTypeManager); void init(final ItemDefinitionRecordEngine recordEngine); } |
@Test public void testNotifyPanel() { final Node node1 = mock(Node.class); final Node node2 = mock(Node.class); final Object definition1 = mock(Object.class); final Object definition2 = mock(Object.class); doReturn(asList(node1, node2)).when(notifier).getNodes(); doReturn(definition1).when(notifier).getDefinition(node1... | public void notifyPanel() { for (final Node node : getNodes()) { final Object definition = getDefinition(node); notifyVariables(node, definition); notifyExpressions(node, definition); } } | PropertiesPanelNotifier { public void notifyPanel() { for (final Node node : getNodes()) { final Object definition = getDefinition(node); notifyVariables(node, definition); notifyExpressions(node, definition); } } } | PropertiesPanelNotifier { public void notifyPanel() { for (final Node node : getNodes()) { final Object definition = getDefinition(node); notifyVariables(node, definition); notifyExpressions(node, definition); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { public void notifyPanel() { for (final Node node : getNodes()) { final Object definition = getDefinition(node); notifyVariables(node, definition); notifyExpressions(node, definition); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { public void notifyPanel() { for (final Node node : getNodes()) { final Object definition = getDefinition(node); notifyVariables(node, definition); notifyExpressions(node, definition); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... |
@Test public void testWbFromDMN() { final String name = "name"; when(ruleAnnotationClause.getName()).thenReturn(name); final RuleAnnotationClause converted = RuleAnnotationClauseConverter.wbFromDMN(ruleAnnotationClause); assertEquals(name, converted.getName().getValue()); } | public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); return rule; } | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... |
@Test public void testOnCanvasSelectionEvent() { final CanvasSelectionEvent selectionEvent = mock(CanvasSelectionEvent.class); final String uuid1 = "uuid1"; final String uuid2 = "uuid2"; final List<String> t = asList(uuid1, uuid2); when(selectionEvent.getIdentifiers()).thenReturn(t); notifier.onCanvasSelectionEvent(sel... | void onCanvasSelectionEvent(final @Observes CanvasSelectionEvent event) { final Collection<String> identifiers = event.getIdentifiers(); if (identifiers.size() > 0) { setSelectedElementUUID(identifiers.iterator().next()); } } | PropertiesPanelNotifier { void onCanvasSelectionEvent(final @Observes CanvasSelectionEvent event) { final Collection<String> identifiers = event.getIdentifiers(); if (identifiers.size() > 0) { setSelectedElementUUID(identifiers.iterator().next()); } } } | PropertiesPanelNotifier { void onCanvasSelectionEvent(final @Observes CanvasSelectionEvent event) { final Collection<String> identifiers = event.getIdentifiers(); if (identifiers.size() > 0) { setSelectedElementUUID(identifiers.iterator().next()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEv... | PropertiesPanelNotifier { void onCanvasSelectionEvent(final @Observes CanvasSelectionEvent event) { final Collection<String> identifiers = event.getIdentifiers(); if (identifiers.size() > 0) { setSelectedElementUUID(identifiers.iterator().next()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEv... | PropertiesPanelNotifier { void onCanvasSelectionEvent(final @Observes CanvasSelectionEvent event) { final Collection<String> identifiers = event.getIdentifiers(); if (identifiers.size() > 0) { setSelectedElementUUID(identifiers.iterator().next()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEv... |
@Test public void testOnDomainObjectSelectionEvent() { final DomainObjectSelectionEvent selectionEvent = mock(DomainObjectSelectionEvent.class); final DomainObject domainObject = mock(DomainObject.class); final String uuid = "uuid"; when(selectionEvent.getDomainObject()).thenReturn(domainObject); when(domainObject.getD... | void onDomainObjectSelectionEvent(final @Observes DomainObjectSelectionEvent event) { setSelectedElementUUID(event.getDomainObject().getDomainObjectUUID()); } | PropertiesPanelNotifier { void onDomainObjectSelectionEvent(final @Observes DomainObjectSelectionEvent event) { setSelectedElementUUID(event.getDomainObject().getDomainObjectUUID()); } } | PropertiesPanelNotifier { void onDomainObjectSelectionEvent(final @Observes DomainObjectSelectionEvent event) { setSelectedElementUUID(event.getDomainObject().getDomainObjectUUID()); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { void onDomainObjectSelectionEvent(final @Observes DomainObjectSelectionEvent event) { setSelectedElementUUID(event.getDomainObject().getDomainObjectUUID()); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { void onDomainObjectSelectionEvent(final @Observes DomainObjectSelectionEvent event) { setSelectedElementUUID(event.getDomainObject().getDomainObjectUUID()); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... |
@Test public void testNotifyExpressions() { final Node node = mock(Node.class); final HasExpression hasExpression = mock(HasExpression.class); final Expression expression = mock(Expression.class); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); when(expressi... | void notifyExpressions(final Node node, final Object definition) { if (definition instanceof HasExpression) { final HasExpression hasExpression = asHasExpression(definition); final List<HasTypeRef> hasTypeRefs = getNotNullHasTypeRefs(hasExpression.getExpression()); for (final HasTypeRef hasTypeRef : hasTypeRefs) { noti... | PropertiesPanelNotifier { void notifyExpressions(final Node node, final Object definition) { if (definition instanceof HasExpression) { final HasExpression hasExpression = asHasExpression(definition); final List<HasTypeRef> hasTypeRefs = getNotNullHasTypeRefs(hasExpression.getExpression()); for (final HasTypeRef hasTyp... | PropertiesPanelNotifier { void notifyExpressions(final Node node, final Object definition) { if (definition instanceof HasExpression) { final HasExpression hasExpression = asHasExpression(definition); final List<HasTypeRef> hasTypeRefs = getNotNullHasTypeRefs(hasExpression.getExpression()); for (final HasTypeRef hasTyp... | PropertiesPanelNotifier { void notifyExpressions(final Node node, final Object definition) { if (definition instanceof HasExpression) { final HasExpression hasExpression = asHasExpression(definition); final List<HasTypeRef> hasTypeRefs = getNotNullHasTypeRefs(hasExpression.getExpression()); for (final HasTypeRef hasTyp... | PropertiesPanelNotifier { void notifyExpressions(final Node node, final Object definition) { if (definition instanceof HasExpression) { final HasExpression hasExpression = asHasExpression(definition); final List<HasTypeRef> hasTypeRefs = getNotNullHasTypeRefs(hasExpression.getExpression()); for (final HasTypeRef hasTyp... |
@Test public void testNotifyVariables() { final Node node = mock(Node.class); final HasVariable hasVariable = mock(HasVariable.class); final IsInformationItem informationItem = mock(IsInformationItem.class); when(hasVariable.getVariable()).thenReturn(informationItem); doNothing().when(notifier).notifyOutdatedElement(an... | void notifyVariables(final Node node, final Object definition) { if (definition instanceof HasVariable) { notifyOutdatedElement(node, asHasVariable(definition).getVariable()); } } | PropertiesPanelNotifier { void notifyVariables(final Node node, final Object definition) { if (definition instanceof HasVariable) { notifyOutdatedElement(node, asHasVariable(definition).getVariable()); } } } | PropertiesPanelNotifier { void notifyVariables(final Node node, final Object definition) { if (definition instanceof HasVariable) { notifyOutdatedElement(node, asHasVariable(definition).getVariable()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { void notifyVariables(final Node node, final Object definition) { if (definition instanceof HasVariable) { notifyOutdatedElement(node, asHasVariable(definition).getVariable()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... | PropertiesPanelNotifier { void notifyVariables(final Node node, final Object definition) { if (definition instanceof HasVariable) { notifyOutdatedElement(node, asHasVariable(definition).getVariable()); } } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
... |
@Test public void testGetDefinition() { final Node node = mock(Node.class); final ViewImpl content = mock(ViewImpl.class); final Object expected = mock(Object.class); when(content.getDefinition()).thenReturn(expected); when(node.getContent()).thenReturn(content); final Object actual = notifier.getDefinition(node); asse... | Object getDefinition(final Node node) { final ViewImpl content = (ViewImpl) node.getContent(); return content.getDefinition(); } | PropertiesPanelNotifier { Object getDefinition(final Node node) { final ViewImpl content = (ViewImpl) node.getContent(); return content.getDefinition(); } } | PropertiesPanelNotifier { Object getDefinition(final Node node) { final ViewImpl content = (ViewImpl) node.getContent(); return content.getDefinition(); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
final SessionManager sessionM... | PropertiesPanelNotifier { Object getDefinition(final Node node) { final ViewImpl content = (ViewImpl) node.getContent(); return content.getDefinition(); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
final SessionManager sessionM... | PropertiesPanelNotifier { Object getDefinition(final Node node) { final ViewImpl content = (ViewImpl) node.getContent(); return content.getDefinition(); } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
final SessionManager sessionM... |
@Test public void testGetNodes() { final Graph graph = mock(Graph.class); final Node node1 = mock(Node.class); final Node node2 = mock(Node.class); final Iterable<Node> expectedNodes = asList(node1, node2); when(graph.nodes()).thenReturn(expectedNodes); doReturn(Optional.of(graph)).when(notifier).getGraph(); final List... | List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } | PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } } | PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
fin... | PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
fin... | PropertiesPanelNotifier { List<Node> getNodes() { final List<Node> nodes = new ArrayList<>(); getGraph().ifPresent(graph -> { graph.nodes().forEach(nodes::add); }); return nodes; } @Inject PropertiesPanelNotifier(final Event<RefreshFormPropertiesEvent> refreshFormPropertiesEvent,
fin... |
@Test public void testGetGraph() { final ClientSession clientSession = mock(ClientSession.class); final CanvasHandler canvasHandler = mock(CanvasHandler.class); final Diagram diagram = mock(Diagram.class); final Optional<Graph> expected = Optional.of(mock(Graph.class)); when(diagram.getGraph()).thenReturn(expected.get(... | Optional<Graph<?, Node>> getGraph() { final Optional<CanvasHandler> canvasHandler = getCurrentSession().map(ClientSession::getCanvasHandler); final Optional<Diagram> diagram = canvasHandler.map(CanvasHandler::getDiagram); return diagram.map(Diagram::getGraph); } | PropertiesPanelNotifier { Optional<Graph<?, Node>> getGraph() { final Optional<CanvasHandler> canvasHandler = getCurrentSession().map(ClientSession::getCanvasHandler); final Optional<Diagram> diagram = canvasHandler.map(CanvasHandler::getDiagram); return diagram.map(Diagram::getGraph); } } | PropertiesPanelNotifier { Optional<Graph<?, Node>> getGraph() { final Optional<CanvasHandler> canvasHandler = getCurrentSession().map(ClientSession::getCanvasHandler); final Optional<Diagram> diagram = canvasHandler.map(CanvasHandler::getDiagram); return diagram.map(Diagram::getGraph); } @Inject PropertiesPanelNotifie... | PropertiesPanelNotifier { Optional<Graph<?, Node>> getGraph() { final Optional<CanvasHandler> canvasHandler = getCurrentSession().map(ClientSession::getCanvasHandler); final Optional<Diagram> diagram = canvasHandler.map(CanvasHandler::getDiagram); return diagram.map(Diagram::getGraph); } @Inject PropertiesPanelNotifie... | PropertiesPanelNotifier { Optional<Graph<?, Node>> getGraph() { final Optional<CanvasHandler> canvasHandler = getCurrentSession().map(ClientSession::getCanvasHandler); final Optional<Diagram> diagram = canvasHandler.map(CanvasHandler::getDiagram); return diagram.map(Diagram::getGraph); } @Inject PropertiesPanelNotifie... |
@Test public void testUpdateWhenDataTypeIsDefault() { final DataType dataType = mock(DataType.class); when(dataType.getType()).thenReturn(BuiltInType.STRING.getName()); handler.update(dataType); verify(dataTypeManager, never()).from(any(DataType.class)); verify(dataTypeManager, never()).withRefreshedSubDataTypes(anyStr... | public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } } | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testUpdateWhenDataTypeIsNotDefault() { final DataType dataType = mock(DataType.class); final String name = "city"; final String type = "tCity"; when(dataType.getName()).thenReturn(name); when(dataType.getType()).thenReturn(type); when(dataTypeManager.from(any(DataType.class))).thenReturn(dataTypeManag... | public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } } | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { public void update(final DataType dataType) { final String type = getTypeName(dataType); if (!isBuiltInType(type)) { dataTypeManager .from(dataType) .withRefreshedSubDataTypes(type); } } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testRefreshDependentDataTypes() { final DataType dataType = mock(DataType.class); final String oldItemDefinitionName = "oldItemDefinitionName"; final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataT... | public List<DataType> refreshDependentDataTypes(final DataType dataType, final String oldItemDefinitionName) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypeUpdate(dataType, oldItemDefinitionName)); affectedDataTypes.addAll(handleNestedDataTypeFieldUpdate(dat... | DataTypeUpdateHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType, final String oldItemDefinitionName) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypeUpdate(dataType, oldItemDefinitionName)); affectedData... | DataTypeUpdateHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType, final String oldItemDefinitionName) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypeUpdate(dataType, oldItemDefinitionName)); affectedData... | DataTypeUpdateHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType, final String oldItemDefinitionName) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypeUpdate(dataType, oldItemDefinitionName)); affectedData... | DataTypeUpdateHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType, final String oldItemDefinitionName) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypeUpdate(dataType, oldItemDefinitionName)); affectedData... |
@Test public void testWbFromDMNWhenIsNull() { final RuleAnnotationClause converted = RuleAnnotationClauseConverter.wbFromDMN(null); assertNull(converted); } | public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); return rule; } | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... | RuleAnnotationClauseConverter { public static RuleAnnotationClause wbFromDMN(final org.kie.dmn.model.api.RuleAnnotationClause ruleAnnotationClause) { if (ruleAnnotationClause == null) { return null; } final RuleAnnotationClause rule = new RuleAnnotationClause(); rule.setName(new Name(ruleAnnotationClause.getName())); r... |
@Test public void testHandleTopLevelDataTypeUpdate() { final DataType dataType = mock(DataType.class); final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final List<DataType> expectedDataTypes = asList(dataType0, dataType1); final String oldItemDefinitionName = "oldItemDef... | List<DataType> handleTopLevelDataTypeUpdate(final DataType dataType, final String oldItemDefinitionName) { return updateAllChildrenWithTheNewTypeName(dataType, oldItemDefinitionName); } | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypeUpdate(final DataType dataType, final String oldItemDefinitionName) { return updateAllChildrenWithTheNewTypeName(dataType, oldItemDefinitionName); } } | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypeUpdate(final DataType dataType, final String oldItemDefinitionName) { return updateAllChildrenWithTheNewTypeName(dataType, oldItemDefinitionName); } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypeUpdate(final DataType dataType, final String oldItemDefinitionName) { return updateAllChildrenWithTheNewTypeName(dataType, oldItemDefinitionName); } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypeUpdate(final DataType dataType, final String oldItemDefinitionName) { return updateAllChildrenWithTheNewTypeName(dataType, oldItemDefinitionName); } @Inject DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testHandleNestedDataTypeFieldUpdateWhenDataTypeIsNotStructure() { final DataType dataType = mock(DataType.class); final DataType topLevelDataType = mock(DataType.class); final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(Da... | List<DataType> handleNestedDataTypeFieldUpdate(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType) .ifPresent(topLevelUpdate -> { refreshSubDataTypes(topLevelUpdate, topLevelUpdate.getName()); if (!isStructure(topLevelUpdate)) { forEachSubDataTypes... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleNestedDataTypeFieldUpdate(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType) .ifPresent(topLevelUpdate -> { refreshSubDataTypes(topLevelUpdate, topLevelUpdate.getName()); if (!is... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleNestedDataTypeFieldUpdate(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType) .ifPresent(topLevelUpdate -> { refreshSubDataTypes(topLevelUpdate, topLevelUpdate.getName()); if (!is... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleNestedDataTypeFieldUpdate(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType) .ifPresent(topLevelUpdate -> { refreshSubDataTypes(topLevelUpdate, topLevelUpdate.getName()); if (!is... | DataTypeUpdateHandler extends DataTypeHandler { List<DataType> handleNestedDataTypeFieldUpdate(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType) .ifPresent(topLevelUpdate -> { refreshSubDataTypes(topLevelUpdate, topLevelUpdate.getName()); if (!is... |
@Test public void testRefreshSubDataType() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); final String newType = "newType"; final String type = "type"; final String uuid = "uuid"; when(dataType.getType()).thenReturn(type); when(dataType.getUUID()).the... | void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTypes(dataType, dataType.getType()); } | DataTypeUpdateHandler extends DataTypeHandler { void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTyp... | DataTypeUpdateHandler extends DataTypeHandler { void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTyp... | DataTypeUpdateHandler extends DataTypeHandler { void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTyp... | DataTypeUpdateHandler extends DataTypeHandler { void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTyp... |
@Test public void testDestroy() { final String uuid = "uuid"; final String parentUUID = "parentUUID"; final String childUUID1 = "childUUID1"; final String childUUID2 = "childUUID2"; final String grandchildUUID1 = "grandchildUUID1"; final String grandchildUUID2 = "grandchildUUID2"; final DataType[] grandchildren = {make... | public void destroy(final DataType dataType) { final Optional<DataType> dataTypeParent = Optional.ofNullable(parent(dataType)); dataTypeParent.ifPresent(parent -> { parent.getSubDataTypes().remove(dataType); }); unIndex(dataType); } | DataTypeDestroyHandler extends DataTypeHandler { public void destroy(final DataType dataType) { final Optional<DataType> dataTypeParent = Optional.ofNullable(parent(dataType)); dataTypeParent.ifPresent(parent -> { parent.getSubDataTypes().remove(dataType); }); unIndex(dataType); } } | DataTypeDestroyHandler extends DataTypeHandler { public void destroy(final DataType dataType) { final Optional<DataType> dataTypeParent = Optional.ofNullable(parent(dataType)); dataTypeParent.ifPresent(parent -> { parent.getSubDataTypes().remove(dataType); }); unIndex(dataType); } @Inject DataTypeDestroyHandler(final ... | DataTypeDestroyHandler extends DataTypeHandler { public void destroy(final DataType dataType) { final Optional<DataType> dataTypeParent = Optional.ofNullable(parent(dataType)); dataTypeParent.ifPresent(parent -> { parent.getSubDataTypes().remove(dataType); }); unIndex(dataType); } @Inject DataTypeDestroyHandler(final ... | DataTypeDestroyHandler extends DataTypeHandler { public void destroy(final DataType dataType) { final Optional<DataType> dataTypeParent = Optional.ofNullable(parent(dataType)); dataTypeParent.ifPresent(parent -> { parent.getSubDataTypes().remove(dataType); }); unIndex(dataType); } @Inject DataTypeDestroyHandler(final ... |
@Test public void testRefreshDependentDataTypes() { final DataType dataType = mock(DataType.class); final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataType dataType3 = mock(DataType.class); doReturn(asList(dataType... | public List<DataType> refreshDependentDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypes(dataType)); affectedDataTypes.addAll(handleNestedDataTypes(dataType)); return affectedDataTypes; } | DataTypeDestroyHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypes(dataType)); affectedDataTypes.addAll(handleNestedDataTypes(dataType)); return affectedD... | DataTypeDestroyHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypes(dataType)); affectedDataTypes.addAll(handleNestedDataTypes(dataType)); return affectedD... | DataTypeDestroyHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypes(dataType)); affectedDataTypes.addAll(handleNestedDataTypes(dataType)); return affectedD... | DataTypeDestroyHandler extends DataTypeHandler { public List<DataType> refreshDependentDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.addAll(handleTopLevelDataTypes(dataType)); affectedDataTypes.addAll(handleNestedDataTypes(dataType)); return affectedD... |
@Test public void testHandleTopLevelDataTypesWhenDataTypeIsNotTopLevel() { final DataType dataType = mock(DataType.class); when(dataType.isTopLevel()).thenReturn(false); final List<DataType> expectedDependentDataTypes = emptyList(); final List<DataType> actualDependentDataTypes = handler.handleTopLevelDataTypes(dataTyp... | List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt : dataTypesByType) { final Optional<DataType> dat... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... |
@Test public void testHandleTopLevelDataTypesWhenDataTypeIsTopLevel() { final DataType dataType = mock(DataType.class); final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataType dataTypeParent0 = mock(DataType.class)... | List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt : dataTypesByType) { final Optional<DataType> dat... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleTopLevelDataTypes(final DataType dataType) { final List<DataType> affected = new ArrayList<>(); if (!dataType.isTopLevel()) { return affected; } final List<DataType> dataTypesByType = getSubDataTypesByType(dataType.getName()); for (final DataType dt ... |
@Test public void testHandleNestedDataTypes() { final DataType dataType = mock(DataType.class); final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataType dataType3 = mock(DataType.class); final DataType dataTypeParen... | List<DataType> handleNestedDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType).ifPresent(topLevel -> { final String type = topLevel.getName(); affectedDataTypes.add(topLevel); refreshSubDataTypes(topLevel, type); if (!isStructure(topLevel... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleNestedDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType).ifPresent(topLevel -> { final String type = topLevel.getName(); affectedDataTypes.add(topLevel); refreshSubDat... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleNestedDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType).ifPresent(topLevel -> { final String type = topLevel.getName(); affectedDataTypes.add(topLevel); refreshSubDat... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleNestedDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType).ifPresent(topLevel -> { final String type = topLevel.getName(); affectedDataTypes.add(topLevel); refreshSubDat... | DataTypeDestroyHandler extends DataTypeHandler { List<DataType> handleNestedDataTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); getClosestTopLevelDataType(dataType).ifPresent(topLevel -> { final String type = topLevel.getName(); affectedDataTypes.add(topLevel); refreshSubDat... |
@Test public void testAppendItemDefinition() { when(itemDefinitionUtils.all()).thenReturn(new ArrayList<>()); final ItemDefinition itemDefinition = handler.appendItemDefinition(); assertTrue(itemDefinitionUtils.all().contains(itemDefinition)); } | public ItemDefinition appendItemDefinition() { final ItemDefinition itemDefinition = new ItemDefinition(); itemDefinitions().add(itemDefinition); return itemDefinition; } | ItemDefinitionCreateHandler { public ItemDefinition appendItemDefinition() { final ItemDefinition itemDefinition = new ItemDefinition(); itemDefinitions().add(itemDefinition); return itemDefinition; } } | ItemDefinitionCreateHandler { public ItemDefinition appendItemDefinition() { final ItemDefinition itemDefinition = new ItemDefinition(); itemDefinitions().add(itemDefinition); return itemDefinition; } @Inject ItemDefinitionCreateHandler(final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionCreateHandler { public ItemDefinition appendItemDefinition() { final ItemDefinition itemDefinition = new ItemDefinition(); itemDefinitions().add(itemDefinition); return itemDefinition; } @Inject ItemDefinitionCreateHandler(final ItemDefinitionUtils itemDefinitionUtils,
... | ItemDefinitionCreateHandler { public ItemDefinition appendItemDefinition() { final ItemDefinition itemDefinition = new ItemDefinition(); itemDefinitions().add(itemDefinition); return itemDefinition; } @Inject ItemDefinitionCreateHandler(final ItemDefinitionUtils itemDefinitionUtils,
... |
@Test public void testLookupAbsoluteParentWhenParentIsNotPresent() { final String referenceUUID = "referenceUUID"; when(itemDefinitionStore.get(referenceUUID)).thenReturn(null); final Optional<ItemDefinition> absoluteParent = handler.lookupAbsoluteParent(referenceUUID); assertFalse(absoluteParent.isPresent()); } | Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructure = parent.getTypeRef() == nul... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... |
@Test public void testDmnFromWB() { final String dmnName = "name"; final Name name = new Name(dmnName); when(dmnRuleAnnotationClause.getName()).thenReturn(name); final org.kie.dmn.model.api.RuleAnnotationClause converted = RuleAnnotationClauseConverter.dmnFromWB(dmnRuleAnnotationClause); assertEquals(dmnName, converted... | public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } static RuleAnno... | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } static RuleAnno... |
@Test public void testLookupAbsoluteParentWhenParentIsStructure() { final String referenceUUID = "referenceUUID"; final ItemDefinition parent = mock(ItemDefinition.class); when(parent.getTypeRef()).thenReturn(null); when(itemDefinitionStore.get(referenceUUID)).thenReturn(parent); final Optional<ItemDefinition> actualPa... | Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructure = parent.getTypeRef() == nul... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... |
@Test public void testLookupAbsoluteParentWhenParentIsNotStructure() { final String type = "type"; final String referenceUUID = "referenceUUID"; final ItemDefinition parent = mock(ItemDefinition.class); final Optional<ItemDefinition> expectedParent = Optional.of(mock(ItemDefinition.class)); final QName qName = mock(QNa... | Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructure = parent.getTypeRef() == nul... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... | ItemDefinitionCreateHandler { Optional<ItemDefinition> lookupAbsoluteParent(final String parentUUID) { final Optional<ItemDefinition> optionalParent = Optional.ofNullable(getIndexedItemDefinition(parentUUID)); if (optionalParent.isPresent()) { final ItemDefinition parent = optionalParent.get(); final boolean isStructur... |
@Test public void testGetWhenItReturnsNull() { assertNull(store.get("456")); } | public DataType get(final String uuid) { return dataTypes.get(uuid); } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); ... |
@Test public void testGetWhenItDoesNotReturnNull() { assertNotNull(store.get(uuid)); assertEquals(dataType, store.get(uuid)); } | public DataType get(final String uuid) { return dataTypes.get(uuid); } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); } | DataTypeStore { public DataType get(final String uuid) { return dataTypes.get(uuid); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); ... |
@Test public void testIndex() { assertEquals(1, store.size()); final DataType secondDataType = mock(DataType.class); final String secondUUID = "789"; store.index(secondUUID, secondDataType); assertEquals(2, store.size()); assertEquals(dataType, store.get(uuid)); assertEquals(secondDataType, store.get(secondUUID)); } | public void index(final String uuid, final DataType dataType) { dataTypes.put(uuid, dataType); } | DataTypeStore { public void index(final String uuid, final DataType dataType) { dataTypes.put(uuid, dataType); } } | DataTypeStore { public void index(final String uuid, final DataType dataType) { dataTypes.put(uuid, dataType); } } | DataTypeStore { public void index(final String uuid, final DataType dataType) { dataTypes.put(uuid, dataType); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unI... | DataTypeStore { public void index(final String uuid, final DataType dataType) { dataTypes.put(uuid, dataType); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unI... |
@Test public void testClear() { store.clear(); assertEquals(0, store.size()); } | public void clear() { dataTypes.clear(); } | DataTypeStore { public void clear() { dataTypes.clear(); } } | DataTypeStore { public void clear() { dataTypes.clear(); } } | DataTypeStore { public void clear() { dataTypes.clear(); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); } | DataTypeStore { public void clear() { dataTypes.clear(); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uuid); } |
@Test public void testGetTopLevelDataTypes() { final String secondUUID = "789"; final String thirdUUID = "012"; final DataType secondDataType = mock(DataType.class); final DataType thirdDataType = mock(DataType.class); when(secondDataType.isTopLevel()).thenReturn(true); store.index(secondUUID, secondDataType); store.in... | public List<DataType> getTopLevelDataTypes() { return all() .stream() .filter(DataType::isTopLevel) .collect(Collectors.toList()); } | DataTypeStore { public List<DataType> getTopLevelDataTypes() { return all() .stream() .filter(DataType::isTopLevel) .collect(Collectors.toList()); } } | DataTypeStore { public List<DataType> getTopLevelDataTypes() { return all() .stream() .filter(DataType::isTopLevel) .collect(Collectors.toList()); } } | DataTypeStore { public List<DataType> getTopLevelDataTypes() { return all() .stream() .filter(DataType::isTopLevel) .collect(Collectors.toList()); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTyp... | DataTypeStore { public List<DataType> getTopLevelDataTypes() { return all() .stream() .filter(DataType::isTopLevel) .collect(Collectors.toList()); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTyp... |
@Test public void testUnIndex() { final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataType dataType3 = mock(DataType.class); final DataType dataType4 = mock(DataType.class); final DataType dataType5 = mock(DataType.... | public void unIndex(final String uuid) { dataTypes.remove(uuid); subDataTypesUUID(uuid).forEach(this::unIndex); } | DataTypeStore { public void unIndex(final String uuid) { dataTypes.remove(uuid); subDataTypesUUID(uuid).forEach(this::unIndex); } } | DataTypeStore { public void unIndex(final String uuid) { dataTypes.remove(uuid); subDataTypesUUID(uuid).forEach(this::unIndex); } } | DataTypeStore { public void unIndex(final String uuid) { dataTypes.remove(uuid); subDataTypesUUID(uuid).forEach(this::unIndex); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType... | DataTypeStore { public void unIndex(final String uuid) { dataTypes.remove(uuid); subDataTypesUUID(uuid).forEach(this::unIndex); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType... |
@Test public void testAll() { final DataType dataType0 = mock(DataType.class); final DataType dataType1 = mock(DataType.class); store.index("0", dataType0); store.index("1", dataType1); final List<DataType> all = store.all(); assertEquals(3, all.size()); assertTrue(all.contains(dataType)); assertTrue(all.contains(dataT... | public List<DataType> all() { return new ArrayList<>(dataTypes.values()); } | DataTypeStore { public List<DataType> all() { return new ArrayList<>(dataTypes.values()); } } | DataTypeStore { public List<DataType> all() { return new ArrayList<>(dataTypes.values()); } } | DataTypeStore { public List<DataType> all() { return new ArrayList<>(dataTypes.values()); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uui... | DataTypeStore { public List<DataType> all() { return new ArrayList<>(dataTypes.values()); } DataType get(final String uuid); void index(final String uuid,
final DataType dataType); void clear(); int size(); List<DataType> getTopLevelDataTypes(); List<DataType> all(); void unIndex(final String uui... |
@Test public void testCreate() { final DataTypeRecordEngine engine = makeRecordEngine(); final DataType record = spy(new DataType(engine)); final DataType reference = mock(DataType.class); final List<DataType> expectedDataTypes = asList(mock(DataType.class), mock(DataType.class)); final CreationType creationType = mock... | public List<DataType> create(final DataType reference, final CreationType creationType) { return getDataTypeRecordEngine().create(getRecord(), reference, creationType); } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> create(final DataType reference, final CreationType creationType) { return getDataTypeRecordEngine().create(getRecord(), reference, creationType); } } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> create(final DataType reference, final CreationType creationType) { return getDataTypeRecordEngine().create(getRecord(), reference, creationType); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> create(final DataType reference, final CreationType creationType) { return getDataTypeRecordEngine().create(getRecord(), reference, creationType); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); List<DataType> create(final Da... | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> create(final DataType reference, final CreationType creationType) { return getDataTypeRecordEngine().create(getRecord(), reference, creationType); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); List<DataType> create(final Da... |
@Test public void testDmnFromWBWhenIsNull() { final org.kie.dmn.model.api.RuleAnnotationClause converted = RuleAnnotationClauseConverter.dmnFromWB(null); assertNull(converted); } | public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } } | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } static RuleAnno... | RuleAnnotationClauseConverter { public static org.kie.dmn.model.api.RuleAnnotationClause dmnFromWB(final RuleAnnotationClause wb) { if (wb == null) { return null; } final org.kie.dmn.model.api.RuleAnnotationClause rule = new TRuleAnnotationClause(); rule.setName(wb.getName().getValue()); return rule; } static RuleAnno... |
@Test public void testDestroyWithoutDependentTypes() { final DataTypeRecordEngine engine = makeRecordEngine(); final DataType record = spy(new DataType(engine)); final List<DataType> expectedDataTypes = singletonList(mock(DataType.class)); doReturn(expectedDataTypes).when(engine).destroyWithoutDependentTypes(record); f... | public List<DataType> destroyWithoutDependentTypes() { return getDataTypeRecordEngine().destroyWithoutDependentTypes(getRecord()); } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> destroyWithoutDependentTypes() { return getDataTypeRecordEngine().destroyWithoutDependentTypes(getRecord()); } } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> destroyWithoutDependentTypes() { return getDataTypeRecordEngine().destroyWithoutDependentTypes(getRecord()); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); } | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> destroyWithoutDependentTypes() { return getDataTypeRecordEngine().destroyWithoutDependentTypes(getRecord()); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); List<DataType> create(final DataType reference,
... | DataTypeActiveRecord extends ActiveRecord<DataType> { public List<DataType> destroyWithoutDependentTypes() { return getDataTypeRecordEngine().destroyWithoutDependentTypes(getRecord()); } DataTypeActiveRecord(final RecordEngine<DataType> recordEngine); List<DataType> create(final DataType reference,
... |
@Test public void testInit() { recordEngine.init(); verify(dataTypeDestroyHandler).init(recordEngine); verify(dataTypeUpdateHandler).init(recordEngine); } | @PostConstruct public void init() { dataTypeCreateHandler.init(this); dataTypeDestroyHandler.init(this); dataTypeUpdateHandler.init(this); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @PostConstruct public void init() { dataTypeCreateHandler.init(this); dataTypeDestroyHandler.init(this); dataTypeUpdateHandler.init(this); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @PostConstruct public void init() { dataTypeCreateHandler.init(this); dataTypeDestroyHandler.init(this); dataTypeUpdateHandler.init(this); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @PostConstruct public void init() { dataTypeCreateHandler.init(this); dataTypeDestroyHandler.init(this); dataTypeUpdateHandler.init(this); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @PostConstruct public void init() { dataTypeCreateHandler.init(this); dataTypeDestroyHandler.init(this); dataTypeUpdateHandler.init(this); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testUpdate() { final String uuid = "uuid"; final String nameValue = "nameValue"; final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); final Name name = mock(Name.class); final List<DataType> expectedDependentDataTypes = asList(mock(DataType.... | @Override public List<DataType> update(final DataType dataType) { if (!dataType.isValid()) { throw new UnsupportedOperationException("An invalid Data Type cannot be updated."); } final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); final String itemDefinitionBeforeUpdate = itemDefinition.g... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> update(final DataType dataType) { if (!dataType.isValid()) { throw new UnsupportedOperationException("An invalid Data Type cannot be updated."); } final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> update(final DataType dataType) { if (!dataType.isValid()) { throw new UnsupportedOperationException("An invalid Data Type cannot be updated."); } final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> update(final DataType dataType) { if (!dataType.isValid()) { throw new UnsupportedOperationException("An invalid Data Type cannot be updated."); } final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> update(final DataType dataType) { if (!dataType.isValid()) { throw new UnsupportedOperationException("An invalid Data Type cannot be updated."); } final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()... |
@Test public void testDoUpdate() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); recordEngine.doUpdate(dataType, itemDefinition); verify(dataTypeUpdateHandler).update(dataType); verify(itemDefinitionUpdateHandler).update(dataType, itemDefinition); } | public void doUpdate(final DataType dataType, final ItemDefinition itemDefinition) { dataTypeUpdateHandler.update(dataType); itemDefinitionUpdateHandler.update(dataType, itemDefinition); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doUpdate(final DataType dataType, final ItemDefinition itemDefinition) { dataTypeUpdateHandler.update(dataType); itemDefinitionUpdateHandler.update(dataType, itemDefinition); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doUpdate(final DataType dataType, final ItemDefinition itemDefinition) { dataTypeUpdateHandler.update(dataType); itemDefinitionUpdateHandler.update(dataType, itemDefinition); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefi... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doUpdate(final DataType dataType, final ItemDefinition itemDefinition) { dataTypeUpdateHandler.update(dataType); itemDefinitionUpdateHandler.update(dataType, itemDefinition); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefi... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doUpdate(final DataType dataType, final ItemDefinition itemDefinition) { dataTypeUpdateHandler.update(dataType); itemDefinitionUpdateHandler.update(dataType, itemDefinition); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefi... |
@Test public void testDestroy() { final DataType dataType = mock(DataType.class); final List<DataType> expectedDependentDataTypes = asList(mock(DataType.class), mock(DataType.class)); when(dataTypeDestroyHandler.refreshDependentDataTypes(dataType)).thenReturn(expectedDependentDataTypes); final List<DataType> actualDepe... | @Override public List<DataType> destroy(final DataType dataType) { doDestroy(dataType); return refreshDependentDataTypesFromDestroyOperation(dataType); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroy(final DataType dataType) { doDestroy(dataType); return refreshDependentDataTypesFromDestroyOperation(dataType); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroy(final DataType dataType) { doDestroy(dataType); return refreshDependentDataTypesFromDestroyOperation(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroy(final DataType dataType) { doDestroy(dataType); return refreshDependentDataTypesFromDestroyOperation(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroy(final DataType dataType) { doDestroy(dataType); return refreshDependentDataTypesFromDestroyOperation(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testDestroyWithoutDependentTypes() { final DataType dataType = mock(DataType.class); final List<DataType> dependentDataTypes = asList(mock(DataType.class), mock(DataType.class)); when(dataTypeDestroyHandler.refreshDependentDataTypes(dataType)).thenReturn(dependentDataTypes); final List<DataType> actua... | @Override public List<DataType> destroyWithoutDependentTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.add(dataType); doDestroy(dataType, false); return affectedDataTypes; } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroyWithoutDependentTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.add(dataType); doDestroy(dataType, false); return affectedDataTypes; } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroyWithoutDependentTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.add(dataType); doDestroy(dataType, false); return affectedDataTypes; } @Inject ItemDefinitio... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroyWithoutDependentTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.add(dataType); doDestroy(dataType, false); return affectedDataTypes; } @Inject ItemDefinitio... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> destroyWithoutDependentTypes(final DataType dataType) { final List<DataType> affectedDataTypes = new ArrayList<>(); affectedDataTypes.add(dataType); doDestroy(dataType, false); return affectedDataTypes; } @Inject ItemDefinitio... |
@Test public void testCreate() { final DataType dataType = mock(DataType.class); final List<DataType> expectedAffectedDataTypes = asList(mock(DataType.class), mock(DataType.class)); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(itemDefinitionCreateHandler.appendItemDefinition()).thenReturn(item... | @Override public List<DataType> create(final DataType dataType) { return dataTypeCreateHandler.append(dataType, itemDefinitionCreateHandler.appendItemDefinition()); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> create(final DataType dataType) { return dataTypeCreateHandler.append(dataType, itemDefinitionCreateHandler.appendItemDefinition()); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> create(final DataType dataType) { return dataTypeCreateHandler.append(dataType, itemDefinitionCreateHandler.appendItemDefinition()); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> create(final DataType dataType) { return dataTypeCreateHandler.append(dataType, itemDefinitionCreateHandler.appendItemDefinition()); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public List<DataType> create(final DataType dataType) { return dataTypeCreateHandler.append(dataType, itemDefinitionCreateHandler.appendItemDefinition()); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
... |
@Test public void testIsValidWhenItIsTrue() { final DataType dataType = mock(DataType.class); doReturn(true).when(dataTypeNameValidator).isValid(dataType); assertTrue(recordEngine.isValid(dataType)); } | @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... |
@Test public void testIsValidWhenItIsFalse() { final DataType dataType = mock(DataType.class); doReturn(false).when(dataTypeNameValidator).isValid(dataType); assertFalse(recordEngine.isValid(dataType)); } | @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { @Override public boolean isValid(final DataType dataType) { return dataTypeNameValidator.isValid(dataType); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyH... |
@Test public void testDoDestroy() { final DataType dataType = mock(DataType.class); recordEngine.doDestroy(dataType); verify(dataTypeDestroyHandler).destroy(dataType); verify(itemDefinitionDestroyHandler).destroy(dataType, true); } | public void doDestroy(final DataType dataType) { doDestroy(dataType, true); } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doDestroy(final DataType dataType) { doDestroy(dataType, true); } } | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doDestroy(final DataType dataType) { doDestroy(dataType, true); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyHandler itemDefinitionDestroyHand... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doDestroy(final DataType dataType) { doDestroy(dataType, true); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyHandler itemDefinitionDestroyHand... | ItemDefinitionRecordEngine implements DataTypeRecordEngine { public void doDestroy(final DataType dataType) { doDestroy(dataType, true); } @Inject ItemDefinitionRecordEngine(final ItemDefinitionStore itemDefinitionStore,
final ItemDefinitionDestroyHandler itemDefinitionDestroyHand... |
@Test public void testAssignAttributes() { final ExternalLink externalLink = mock(ExternalLink.class); final HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class); when(reader.getAttribute(NAME)).thenReturn(TEST_NAME); when(reader.getAttribute(URL)).thenReturn(TEST_URL); converter.assignAttributes(read... | @Override protected void assignAttributes(final HierarchicalStreamReader reader, final Object parent) { superAssignAttributes(reader, parent); final ExternalLink externalLink = (ExternalLink) parent; externalLink.setName(reader.getAttribute(NAME)); externalLink.setUrl(reader.getAttribute(URL)); } | ExternalLinksConverter extends DMNModelInstrumentedBaseConverter { @Override protected void assignAttributes(final HierarchicalStreamReader reader, final Object parent) { superAssignAttributes(reader, parent); final ExternalLink externalLink = (ExternalLink) parent; externalLink.setName(reader.getAttribute(NAME)); exte... | ExternalLinksConverter extends DMNModelInstrumentedBaseConverter { @Override protected void assignAttributes(final HierarchicalStreamReader reader, final Object parent) { superAssignAttributes(reader, parent); final ExternalLink externalLink = (ExternalLink) parent; externalLink.setName(reader.getAttribute(NAME)); exte... | ExternalLinksConverter extends DMNModelInstrumentedBaseConverter { @Override protected void assignAttributes(final HierarchicalStreamReader reader, final Object parent) { superAssignAttributes(reader, parent); final ExternalLink externalLink = (ExternalLink) parent; externalLink.setName(reader.getAttribute(NAME)); exte... | ExternalLinksConverter extends DMNModelInstrumentedBaseConverter { @Override protected void assignAttributes(final HierarchicalStreamReader reader, final Object parent) { superAssignAttributes(reader, parent); final ExternalLink externalLink = (ExternalLink) parent; externalLink.setName(reader.getAttribute(NAME)); exte... |
@Test public void testInit() { verify(dataTypeEditor).addValueChangeHandler(valueChangeHandlerCaptor.capture()); valueChangeHandlerCaptor.getValue().onValueChange(valueChangeEvent); assertEquals(view.getCurrentTypeRef(), typeRef); verify(view).setKeyDownListeners(); } | @Override public void init(final Presenter presenter) { this.presenter = presenter; typeRefEditor.addValueChangeHandler(e -> currentTypeRef = e.getValue()); setKeyDownListeners(); } | ValueAndDataTypePopoverViewImpl extends AbstractPopoverViewImpl implements ValueAndDataTypePopoverView { @Override public void init(final Presenter presenter) { this.presenter = presenter; typeRefEditor.addValueChangeHandler(e -> currentTypeRef = e.getValue()); setKeyDownListeners(); } } | ValueAndDataTypePopoverViewImpl extends AbstractPopoverViewImpl implements ValueAndDataTypePopoverView { @Override public void init(final Presenter presenter) { this.presenter = presenter; typeRefEditor.addValueChangeHandler(e -> currentTypeRef = e.getValue()); setKeyDownListeners(); } ValueAndDataTypePopoverViewImpl()... | ValueAndDataTypePopoverViewImpl extends AbstractPopoverViewImpl implements ValueAndDataTypePopoverView { @Override public void init(final Presenter presenter) { this.presenter = presenter; typeRefEditor.addValueChangeHandler(e -> currentTypeRef = e.getValue()); setKeyDownListeners(); } ValueAndDataTypePopoverViewImpl()... | ValueAndDataTypePopoverViewImpl extends AbstractPopoverViewImpl implements ValueAndDataTypePopoverView { @Override public void init(final Presenter presenter) { this.presenter = presenter; typeRefEditor.addValueChangeHandler(e -> currentTypeRef = e.getValue()); setKeyDownListeners(); } ValueAndDataTypePopoverViewImpl()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.