### Question:
CustomPageService { protected GroovyClassLoader buildPageClassloader(final APISession apiSession, final String pageName, final File pageDirectory) throws CompilationFailedException, IOException { GroovyClassLoader pageClassLoader = PAGES_CLASSLOADERS.get(pageName); final BDMClientDependenciesResolver bdmDependenciesResolver = new BDMClientDependenciesResolver(apiSession); if (pageClassLoader == null || getConsoleProperties(apiSession).isPageInDebugMode() || isOutdated(pageClassLoader, bdmDependenciesResolver)) { synchronized (CustomPageService.class) { pageClassLoader = new GroovyClassLoader(getParentClassloader(pageName, new CustomPageDependenciesResolver(pageName, pageDirectory, getWebBonitaConstantsUtils(apiSession)), bdmDependenciesResolver)); pageClassLoader.addClasspath(pageDirectory.getPath()); PAGES_CLASSLOADERS.put(pageName, pageClassLoader); } } return pageClassLoader; }  GroovyClassLoader getPageClassloader(final APISession apiSession, final PageResourceProvider pageResourceProvider); void ensurePageFolderIsPresent(final APISession apiSession, final PageResourceProvider pageResourceProvider); void ensurePageFolderIsUpToDate(final APISession apiSession, final PageResourceProvider pageResourceProvider); @SuppressWarnings("unchecked") Class<?> registerPage(final GroovyClassLoader pageClassLoader, final PageResourceProvider pageResourceProvider); Class<?> registerRestApiPage(final GroovyClassLoader pageClassLoader, final File restApiControllerFile); void verifyPageClass(final File tempPageDirectory, APISession session); PageController loadPage(final Class<PageController> pageClass); RestApiController loadRestApiPage(final Class<RestApiController> restApiControllerClass); void removePage(final APISession apiSession, final String pageName); void removePage(final APISession apiSession, final Page page); File getGroovyPageFile(final File pageDirectory); File getPageFile(final File pageDirectory, final String fileName); Properties getPageProperties(final APISession apiSession, final byte[] zipContent,
            final boolean checkIfItAlreadyExists,
            final Long processDefinitionId); Set<String> getCustomPagePermissions(final Properties pageProperties,
            final ResourcesPermissionsMapping resourcesPermissionsMapping,
            final boolean alsoReturnResourcesNotFound); Page getPage(final APISession apiSession, final String pageName, final long processDefinitionId); Page getPage(final APISession apiSession, final long pageId); void removeRestApiExtensionPermissions(final ResourcesPermissionsMapping resourcesPermissionsMapping,
            final PageResourceProvider pageResourceProvider, final APISession apiSession); PageResourceProvider getPageResourceProvider(final Page page, final long tenantId); static void clearCachedClassloaders(); void writePageToTemp(Page page, 
            PageResourceProvider pageResourceProvider,
            File unzipPageTempFolder,
            ResourcesPermissionsMapping resourcesPermissionsMapping,
            CompoundPermissionsMapping compoundPermissionsMapping, 
            APISession session); static final String GET_SYSTEM_SESSION; static final String GET_PORTAL_PROFILE; static final String GET_IDENTITY_USER; static final String PAGE_CONTROLLER_FILENAME; static final String PAGE_INDEX_NAME; static final String PAGE_INDEX_FILENAME; static final String LASTUPDATE_FILENAME; static final String RESOURCES_PROPERTY; static final String PROPERTY_CONTENT_TYPE; static final String PROPERTY_API_EXTENSIONS; static final String PROPERTY_METHOD_MASK; static final String PROPERTY_PATH_TEMPLATE_MASK; static final String PROPERTY_PERMISSIONS_MASK; static final String RESOURCE_PERMISSION_KEY_MASK; static final String RESOURCE_PERMISSION_VALUE; static final String EXTENSION_SEPARATOR; static final String NAME_PROPERTY; }### Answer:
@Test public void should_add_page_root_folder_in_classpath() throws Exception { final File pageDir = new File(getClass().getResource("/ARootPageFolder").getFile()); final GroovyClassLoader classloader = customPageService.buildPageClassloader(apiSession, "pageName", pageDir); assertThat(classloader.loadClass("AbstractIndex")).isNotNull(); assertThat(classloader.loadClass("Index")).isNotNull(); assertThat(classloader.loadClass("org.company.test.Util")).isNotNull(); assertThat(classloader.getResource("org/company/test/config.properties")).isNotNull(); }