XmlTransformService extends ServiceImp { public void setMetadataKey(String s) { if ("".equals(s)) { throw new IllegalArgumentException("null param"); } metadataKey = s; } XmlTransformService(); @Override void doService(AdaptrisMessage msg); @Override void prepare(); String getUrl(); void setUrl(String s); String getMetadataKey(); void setMetadataKey(String s); Boolean getCacheTransforms(); void setCacheTransforms(Boolean b); Boolean getAllowOverride(); void setAllowOverride(Boolean b); String getOutputMessageEncoding(); void setOutputMessageEncoding(String s); XmlTransformerFactory getXmlTransformerFactory(); void setXmlTransformerFactory(XmlTransformerFactory xmlTransformerFactory); XmlTransformParameter getTransformParameter(); void setTransformParameter(XmlTransformParameter param);  }
@Test public void testSetMetadataKey() { try { XmlTransformService service = new XmlTransformService(); service.setMetadataKey(""); fail(); } catch (IllegalArgumentException expected) { } XmlTransformService service = new XmlTransformService(); service.setMetadataKey("key"); assertEquals("key", service.getMetadataKey()); }