### Question:
ExtensionStore { public String registerExtension(final String extensionName, final String path, final String description, String extensionOwner) throws URISyntaxException, FalconException { if (!metaStore.checkIfExtensionExists(extensionName)) { URI uri = new URI(path); assertURI("Scheme", uri.getScheme()); assertURI("Authority", uri.getAuthority()); assertURI("Path", uri.getPath()); FileSystem fileSystem = getHdfsFileSystem(path); try { fileSystem.listStatus(new Path(uri.getPath() + "/README")); } catch (IOException e) { LOG.error("Exception in registering Extension:{}", extensionName, e); throw new ValidationException("README file is not present in the " + path); } PathFilter filter = new PathFilter() { public boolean accept(Path file) { return file.getName().endsWith(".jar"); } }; FileStatus[] jarStatus; try { jarStatus = fileSystem.listStatus(new Path(uri.getPath(), "libs/build"), filter); if (jarStatus.length <= 0) { throw new ValidationException("Jars are not present in the " + uri.getPath() + "/libs/build."); } } catch (IOException e) { LOG.error("Exception in registering Extension:{}", extensionName, e); throw new ValidationException("Jars are not present in the " + uri.getPath() + "/libs/build."); } FileStatus[] propStatus; try { propStatus = fileSystem.listStatus(new Path(uri.getPath() , "META")); if (propStatus.length <= 0) { throw new ValidationException("No properties file is not present in the " + uri.getPath() + "/META" + " structure."); } } catch (IOException e) { LOG.error("Exception in registering Extension:{}", extensionName, e); throw new ValidationException("Directory is not present in the " + uri.getPath() + "/META" + " structure."); } metaStore.storeExtensionBean(extensionName, path, ExtensionType.CUSTOM, description, extensionOwner); } else { throw new ValidationException(extensionName + " already exists."); } LOG.info("Extension :" + extensionName + " registered successfully."); return "Extension :" + extensionName + " registered successfully."; } private  ExtensionStore(); static ExtensionMetaStore getMetaStore(); static ExtensionStore get(); Map<String, String> getExtensionResources(final String extensionName); String getExtensionLibPath(final String extensionName); String getExtensionResource(final String resourcePath); String deleteExtension(final String extensionName, String currentUser); String registerExtension(final String extensionName, final String path, final String description,
                                    String extensionOwner); String getResource(final String extensionResourcePath); Path getExtensionStorePath(); boolean isExtensionStoreInitialized(); String updateExtensionStatus(final String extensionName, String currentUser, ExtensionStatus status);  }### Answer:
@Test public void testRegisterExtension() throws IOException, URISyntaxException, FalconException { String extensionPath = EXTENSION_PATH + "testRegister"; createLibs(extensionPath); createReadmeAndJar(extensionPath); createMETA(extensionPath); store = ExtensionStore.get(); store.registerExtension("test", STORAGE_URL + extensionPath, "test desc", "falconUser"); ExtensionMetaStore metaStore = new ExtensionMetaStore(); Assert.assertEquals(metaStore.getAllExtensions().size(), 1); }