### Question:
RequireJsGenerator { public static RequireJsGenerator parseJsonPackage( InputStream inputStream ) { try { Map<String, Object> json = parseJson( inputStream ); return new RequireJsGenerator( json ); } catch ( Exception ignored ) { } return null; } 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 testConfigFromPackageJson() throws IOException, ParseException { RequireJsGenerator moduleInfo = RequireJsGenerator.parseJsonPackage( getResourceAsStream( PACKAGE_JSON ) ); assertNotNull( moduleInfo ); RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator .ArtifactInfo( "org.webjars.npm", "asap", "2.0.3" ); assertEquals( getExpectedOutput( PACKAGE_REQUIRE_JSON ), getRequireJsConfig( moduleInfo, artifactInfo ) ); }
@Test public void testConfigFromBowerJson() throws IOException, ParseException { RequireJsGenerator moduleInfo = RequireJsGenerator.parseJsonPackage( getResourceAsStream( BOWER_JSON ) ); assertNotNull( moduleInfo ); RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator .ArtifactInfo( "org.webjars.bower", "angular-ui-router.stateHelper", "1.3.1" ); assertEquals( getExpectedOutput( BOWER_REQUIRE_JSON ), getRequireJsConfig( moduleInfo, artifactInfo ) ); }