@Test public void testGetName() { String defaultString; defaultString = "defString"; when(mockReader.getAttributeValue(any(String.class), any(String.class))).thenReturn("specifiedString"); assertEquals("specifiedString", XmiReader.getName(mockReader, defaultString, sampleAttribute)); when(mockReader.getAttributeValue(any(String.class), any(String.class))).thenReturn(null); assertEquals(defaultString, XmiReader.getName(mockReader, defaultString, sampleAttribute)); }
protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else { return defaultName; } }
XmiReader { protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else { return defaultName; } } }
XmiReader { protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else { return defaultName; } }  }
XmiReader { protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else { return defaultName; } }  static final Model readModel(final File file); static final Model readModel(final InputStream stream); static final Model readModel(final String fileName); }
XmiReader { protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else { return defaultName; } }  static final Model readModel(final File file); static final Model readModel(final InputStream stream); static final Model readModel(final String fileName);  }