@Test public void testDmnFromWBWhenWBIsNotNull() { final String expectedId = "id"; final String expectedName = "name"; final Id id = new Id(expectedId); final Name name = new Name(expectedName); final String qNameNamespaceURI = "qName namespaceURI"; final String qNameLocalPart = "qName local part"; final String qNamePrefix = "qName prefix"; final InformationItemPrimary wb = mock(InformationItemPrimary.class); final QName qName = mock(QName.class); final javax.xml.namespace.QName expectedQName = new javax.xml.namespace.QName(qNameNamespaceURI, qNameLocalPart, qNamePrefix); final NamedElement parentElement = mock(NamedElement.class); when(wb.getId()).thenReturn(id); when(wb.getName()).thenReturn(name); when(wb.getTypeRef()).thenReturn(qName); when(wb.getParent()).thenReturn(parentElement); when(parentElement.getName()).thenReturn(name); when(qName.getNamespaceURI()).thenReturn(qNameNamespaceURI); when(qName.getLocalPart()).thenReturn(qNameLocalPart); when(qName.getPrefix()).thenReturn(qNamePrefix); final TInformationItem informationItem = InformationItemPrimaryPropertyConverter.dmnFromWB(wb, wb); final String actualId = informationItem.getId(); final String actualName = informationItem.getName(); final javax.xml.namespace.QName actualQName = informationItem.getTypeRef(); assertEquals(expectedId, actualId); assertEquals(expectedName, actualName); assertEquals(expectedQName, actualQName); }
public static TInformationItem dmnFromWB(final InformationItemPrimary wb, final DMNModelInstrumentedBase parent) { if (wb == null) { return null; } final TInformationItem result = new TInformationItem(); final QName typeRef = wb.getTypeRef(); result.setId(wb.getId().getValue()); result.setName(getParentName(parent)); QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); return result; }
InformationItemPrimaryPropertyConverter { public static TInformationItem dmnFromWB(final InformationItemPrimary wb, final DMNModelInstrumentedBase parent) { if (wb == null) { return null; } final TInformationItem result = new TInformationItem(); final QName typeRef = wb.getTypeRef(); result.setId(wb.getId().getValue()); result.setName(getParentName(parent)); QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); return result; } }
InformationItemPrimaryPropertyConverter { public static TInformationItem dmnFromWB(final InformationItemPrimary wb, final DMNModelInstrumentedBase parent) { if (wb == null) { return null; } final TInformationItem result = new TInformationItem(); final QName typeRef = wb.getTypeRef(); result.setId(wb.getId().getValue()); result.setName(getParentName(parent)); QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); return result; }  }
InformationItemPrimaryPropertyConverter { public static TInformationItem dmnFromWB(final InformationItemPrimary wb, final DMNModelInstrumentedBase parent) { if (wb == null) { return null; } final TInformationItem result = new TInformationItem(); final QName typeRef = wb.getTypeRef(); result.setId(wb.getId().getValue()); result.setName(getParentName(parent)); QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); return result; }  static InformationItemPrimary wbFromDMN(final InformationItem dmn,
                                                   final org.kie.dmn.model.api.DMNModelInstrumentedBase parent); static TInformationItem dmnFromWB(final InformationItemPrimary wb,
                                             final DMNModelInstrumentedBase parent); }
InformationItemPrimaryPropertyConverter { public static TInformationItem dmnFromWB(final InformationItemPrimary wb, final DMNModelInstrumentedBase parent) { if (wb == null) { return null; } final TInformationItem result = new TInformationItem(); final QName typeRef = wb.getTypeRef(); result.setId(wb.getId().getValue()); result.setName(getParentName(parent)); QNamePropertyConverter.setDMNfromWB(typeRef, result::setTypeRef); return result; }  static InformationItemPrimary wbFromDMN(final InformationItem dmn,
                                                   final org.kie.dmn.model.api.DMNModelInstrumentedBase parent); static TInformationItem dmnFromWB(final InformationItemPrimary wb,
                                             final DMNModelInstrumentedBase parent);  }