### Question:
RequireJsPackageImpl implements IRequireJsPackage { @Override public boolean hasScript( String name ) { return this.scripts.containsKey( name ); } RequireJsPackageImpl( IPentahoWebPackage pentahoWebPackage, URI resourceRoot ); @Override String getName(); @Override String getVersion(); @Override String getWebRootPath(); @Override boolean preferGlobal(); @Override Map<String, String> getModules(); @Override String getModuleMainFile( String moduleId ); @Override Map<String, String> getDependencies(); @Override boolean hasScript( String name ); @Override URL getScriptResource( String name ); @Override Map<String, Map<String, ?>> getConfig(); @Override Map<String, Map<String, String>> getMap(); @Override Map<String, Map<String, ?>> getShim();  }### Answer:
@Test public void testHasScript() { Map<String, String> expectedScripts = new HashMap<>(); expectedScripts.put( "a", "a.js" ); expectedScripts.put( "b", "b.js" ); Map<String, Object> scripts = new HashMap<>(); scripts.put( "scripts", expectedScripts ); when( mockPentahoWebPackage.getPackageJson() ).thenReturn( scripts ); this.requireJsPackage = new RequireJsPackageImpl( this.mockPentahoWebPackage, this.resourceRootUri ); String scriptThatShouldExist = "a"; boolean hasScript = this.requireJsPackage.hasScript( scriptThatShouldExist ); assertTrue( hasScript ); }