### Question:
SynapseImportFactory { @SuppressWarnings({"UnusedDeclaration"}) public static SynapseImport createImport(OMElement elem, Properties properties) { OMAttribute pkgAtt = elem.getAttribute(PACKAGE_Q); SynapseImport synapseImport = new SynapseImport(); OMAttribute nameAtt = elem.getAttribute(NAME_Q); if (nameAtt != null) { synapseImport.setLibName(nameAtt.getAttributeValue()); } else { handleException("Synapse Import Target Library name is not specified"); } if (pkgAtt != null) { synapseImport.setLibPackage(pkgAtt.getAttributeValue()); } else { handleException("Synapse Import Target Library package is not specified"); } OMAttribute status = elem.getAttribute(STATUS_Q); if (status != null && status.getAttributeValue().equals("enabled")) { synapseImport.setStatus(true); } else { synapseImport.setStatus(false); } log.info("Successfully created Synapse Import: " + nameAtt.getAttributeValue()); return synapseImport; }  @SuppressWarnings({"UnusedDeclaration"}) static SynapseImport createImport(OMElement elem, Properties properties); static final QName NAME_Q; static final QName PACKAGE_Q; static final QName STATUS_Q; static final QName ARTIFACT_Q; }### Answer:
@Test public void testCreateImport() throws XMLStreamException { Properties properties = new Properties(); OMElement element = AXIOMUtil.stringToOM(XML1); try { SynapseImportFactory.createImport(element,properties); Assert.fail("execution successful where exception is expected"); } catch (Exception ex) { Assert.assertEquals("asserting exception class",SynapseException.class,ex.getClass()); Assert.assertEquals("asserting exception message", "Synapse Import Target Library name is not specified",ex.getMessage()); } element = AXIOMUtil.stringToOM(XML2); try { SynapseImportFactory.createImport(element,properties); Assert.fail("execution successful where exception is expected"); } catch (Exception ex) { Assert.assertEquals("asserting exception class",SynapseException.class,ex.getClass()); Assert.assertEquals("asserting exception message", "Synapse Import Target Library package is not specified",ex.getMessage()); } element = AXIOMUtil.stringToOM(XML3); SynapseImport synapseImport = SynapseImportFactory.createImport(element,properties); Assert.assertFalse("status should be false when status data not provided",synapseImport.isStatus()); element = AXIOMUtil.stringToOM(XML4); synapseImport = SynapseImportFactory.createImport(element,properties); Assert.assertTrue("status should be enabled as specified in XML",synapseImport.isStatus()); }