### Question:
RequireJsGenerator { public static RequireJsGenerator parsePom( InputStream inputStream ) throws Exception { try { byte[] bytes = IOUtils.toByteArray( inputStream ); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true ); documentBuilderFactory.setFeature( "http: Document pom = documentBuilderFactory.newDocumentBuilder().parse( new ByteArrayInputStream( bytes ) ); return new RequireJsGenerator( pom ); } catch ( Exception e ) { throw new Exception( "Error reading POM", e ); } } private  RequireJsGenerator( Document pom ); private  RequireJsGenerator( String moduleName, String moduleVersion, String jsScript ); private  RequireJsGenerator( Map<String, Object> json ); private  RequireJsGenerator( String moduleName, String moduleVersion ); static RequireJsGenerator parsePom( InputStream inputStream ); static RequireJsGenerator processJsScript( String moduleName, String moduleVersion, InputStream inputStream ); static RequireJsGenerator parseJsonPackage( InputStream inputStream ); static RequireJsGenerator emptyGenerator( String physicalPathNamePart, String physicalPathVersionPart ); static String getWebjarVersionFromPom( InputStream inputStream ); static Map<String, Object> getPackageOverrides( String group, String artifactId, String version ); static boolean findAmdDefine( InputStream is, ArrayList<String> exports ); ModuleInfo getModuleInfo(); ModuleInfo getConvertedConfig( ArtifactInfo artifactInfo, boolean isAmdPackage, String exports, Map<String, Object> overrides );  }### Answer:
@Test public void testConfigFromPom() throws Exception { RequireJsGenerator moduleInfo = RequireJsGenerator.parsePom( getResourceAsStream( POM_REQUIRE_XML ) ); RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator .ArtifactInfo( "org.webjars", "smart-table", "2.0.3-1" ); assertEquals( getExpectedOutput( POM_REQUIRE_JSON ), getRequireJsConfig( moduleInfo, artifactInfo ) ); }
@Test public void testArtifactInfoURL() throws Exception { RequireJsGenerator moduleInfo = RequireJsGenerator.parsePom( getResourceAsStream( POM_REQUIRE_XML ) ); RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator .ArtifactInfo( new URL( "mvn:org.webjars/smart-table/2.0.3-1" ) ); assertEquals( getExpectedOutput( POM_REQUIRE_JSON ), getRequireJsConfig( moduleInfo, artifactInfo ) ); assertEquals( "2.0.3.1", artifactInfo.getOsgiCompatibleVersion() ); }