LineSvgNodeRenderer extends AbstractSvgNodeRenderer implements IMarkerCapable { float getAttribute(Map<String, String> attributes, String key) { String value = attributes.get(key); if (value != null && !value.isEmpty()) { return CssUtils.parseAbsoluteLength(attributes.get(key)); } return 0; }  @Override void doDraw(SvgDrawContext context); @Override ISvgNodeRenderer createDeepCopy(); @Override void drawMarker(SvgDrawContext context, final MarkerVertexType markerVertexType); @Override double getAutoOrientAngle(MarkerSvgNodeRenderer marker, boolean reverse);  }
@Test public void getAttributeTest() { float expected = 0.75f; LineSvgNodeRenderer lineSvgNodeRenderer = new LineSvgNodeRenderer(); Map<String, String> attributes = new HashMap<>(); attributes.put("key", "1.0"); float actual = lineSvgNodeRenderer.getAttribute(attributes, "key"); Assert.assertEquals(expected, actual, 0f); }
@Test public void getNotPresentAttributeTest() { float expected = 0f; LineSvgNodeRenderer lineSvgNodeRenderer = new LineSvgNodeRenderer(); Map<String, String> attributes = new HashMap<>(); attributes.put("key", "1.0"); float actual = lineSvgNodeRenderer.getAttribute(attributes, "notHere"); Assert.assertEquals(expected, actual, 0f); }