@Test public void testGetDmnElementRef() { final DMNMarshallerStandalone marshaller = spy(getDMNMarshaller()); final String expected = "localPart"; final DMNShape shape = mock(DMNShape.class); final javax.xml.namespace.QName ref = mock(javax.xml.namespace.QName.class); when(ref.getLocalPart()).thenReturn(expected); when(shape.getDmnElementRef()).thenReturn(ref); final String actual = marshaller.getDmnElementRef(shape); assertEquals(expected, actual); }
String getDmnElementRef(final DMNShape dmnShape) { return Optional .ofNullable(dmnShape.getDmnElementRef()) .map(QName::getLocalPart) .orElse(""); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { String getDmnElementRef(final DMNShape dmnShape) { return Optional .ofNullable(dmnShape.getDmnElementRef()) .map(QName::getLocalPart) .orElse(""); } }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { String getDmnElementRef(final DMNShape dmnShape) { return Optional .ofNullable(dmnShape.getDmnElementRef()) .map(QName::getLocalPart) .orElse(""); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { String getDmnElementRef(final DMNShape dmnShape) { return Optional .ofNullable(dmnShape.getDmnElementRef()) .map(QName::getLocalPart) .orElse(""); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { String getDmnElementRef(final DMNShape dmnShape) { return Optional .ofNullable(dmnShape.getDmnElementRef()) .map(QName::getLocalPart) .orElse(""); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); static final String INFO_REQ_ID; static final String KNOWLEDGE_REQ_ID; static final String AUTH_REQ_ID; static final String ASSOCIATION_ID; }