### Question:
RequireJsConfigManager { public String getRequireJsConfig( String baseUrl ) { baseUrl = baseUrl.endsWith( "/" ) ? baseUrl : baseUrl + "/"; String result = null; int tries = 3; Exception lastException = null; while ( tries-- > 0 && result == null ) { Future<String> cache = this.getCachedConfiguration( baseUrl ); try { result = cache.get(); } catch ( InterruptedException e ) { } catch ( ExecutionException e ) { lastException = e; this.invalidateCachedConfigurations(); } } if ( result == null ) { result = "{}; if ( lastException != null && lastException.getCause() != null ) { result += lastException.getCause().getMessage(); } else { result += "unknown error"; } } return result; }  void setPackageConfigurationsTracker( RequireJsPackageServiceTracker packageConfigurationsTracker ); void setExternalResourcesScriptsTracker( RequireJsBundleListener externalResourcesScriptsTracker ); void setPlugins( List<IRequireJsPackageConfigurationPlugin> plugins ); void destroy(); String getRequireJsConfig( String baseUrl ); String getContextMapping( String baseUrl, String referer ); void invalidateCachedConfigurations();  }### Answer:
@Test public void testGetRequireJsConfig() throws Exception { RequireJsConfigManager spyed = spy( this.requireJsConfigManager ); Callable mockCallable = mock( Callable.class ); doReturn( "The content of the requirejs configuration script" ).when( mockCallable ).call(); doReturn( mockCallable ).when( spyed ).createRebuildCacheCallable( this.baseUrl ); String config = spyed.getRequireJsConfig( this.baseUrl ); assertEquals( "The content of the requirejs configuration script", config ); verify( spyed, times( 1 ) ).createRebuildCacheCallable( this.baseUrl ); }