@Test public void testWriteAssociation() throws Exception { final Multiplicity multiplicity = new Multiplicity(new Range(Occurs.ZERO, Occurs.ONE)); final Identifier id = Identifier.fromString("1234"); final AssociationEnd mockEnd = new AssociationEnd(multiplicity, "test", true, id, "test"); final ClassType mockClassType = Mockito.mock(ClassType.class); final ModelIndex mockIndex = Mockito.mock(ModelIndex.class); final Uml2XsdPluginWriter mockWriter = Mockito.mock(Uml2XsdPluginWriter.class); final Type mockType = Mockito.mock(Type.class); Mockito.when(mockIndex.getType(id)).thenReturn(mockType); Mockito.when(mockType.getName()).thenReturn("TypeName"); pluginForREST.writeAssociation(mockClassType, mockEnd, mockIndex, mockWriter); Mockito.verify(mockWriter).element(); Mockito.verify(mockWriter).minOccurs(Occurs.ZERO); Mockito.verify(mockWriter).maxOccurs(Occurs.ONE); Mockito.verify(mockWriter, Mockito.atLeastOnce()).end(); }
@Override public void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model, final Uml2XsdPluginWriter xsw) { if (end.isNavigable()) { writeEmbedded(complexType, end, model, xsw); } }
PluginForREST implements Uml2XsdPlugin { @Override public void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model, final Uml2XsdPluginWriter xsw) { if (end.isNavigable()) { writeEmbedded(complexType, end, model, xsw); } } }
PluginForREST implements Uml2XsdPlugin { @Override public void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model, final Uml2XsdPluginWriter xsw) { if (end.isNavigable()) { writeEmbedded(complexType, end, model, xsw); } }  }
PluginForREST implements Uml2XsdPlugin { @Override public void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model, final Uml2XsdPluginWriter xsw) { if (end.isNavigable()) { writeEmbedded(complexType, end, model, xsw); } }  @Override Map<String, String> declarePrefixMappings(); @Override QName getElementName(final String name, final boolean isReference); @Override QName getElementType(final String name, final boolean isAssociation); @Override QName getGraphAssociationEndName(final PsmDocument<Type> classType); @Override QName getElementName(final PsmDocument<Type> classType); @Override String getTargetNamespace(); @Override QName getTypeName(final String name); @Override boolean isAttributeFormDefaultQualified(); @Override boolean isElementFormDefaultQualified(); @Override boolean isEnabled(final QName name); @Override void writeAppInfo(final TaggedValue taggedValue, final ModelIndex lookup, final Uml2XsdPluginWriter xsw); @Override void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); void writeEmbedded(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); void writeReference(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); @Override void writeTopLevelElement(final PsmDocument<Type> classType, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); }
PluginForREST implements Uml2XsdPlugin { @Override public void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model, final Uml2XsdPluginWriter xsw) { if (end.isNavigable()) { writeEmbedded(complexType, end, model, xsw); } }  @Override Map<String, String> declarePrefixMappings(); @Override QName getElementName(final String name, final boolean isReference); @Override QName getElementType(final String name, final boolean isAssociation); @Override QName getGraphAssociationEndName(final PsmDocument<Type> classType); @Override QName getElementName(final PsmDocument<Type> classType); @Override String getTargetNamespace(); @Override QName getTypeName(final String name); @Override boolean isAttributeFormDefaultQualified(); @Override boolean isElementFormDefaultQualified(); @Override boolean isEnabled(final QName name); @Override void writeAppInfo(final TaggedValue taggedValue, final ModelIndex lookup, final Uml2XsdPluginWriter xsw); @Override void writeAssociation(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); void writeEmbedded(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); void writeReference(final ClassType complexType, final AssociationEnd end, final ModelIndex model,
            final Uml2XsdPluginWriter xsw); @Override void writeTopLevelElement(final PsmDocument<Type> classType, final ModelIndex model,
            final Uml2XsdPluginWriter xsw);  }