### Question:
SharelibResolver { public String[] resolve() { for (SharelibNameProvider cp : configProviders) { if (isValidSharelibProperty(cp.getSharelibNames())) { return cp.getSharelibNames(); } } return defaultValue; } SharelibResolver(final String sharelibPropertyName, final Configuration actionConf,
                     final XConfiguration workflowConf, final Configuration oozieServerConfiguration,
                     final String defaultValue); String[] resolve();  }### Answer:
@Test public void testResolvingOrder() { Configuration oozieServerConfiguration = new Configuration(false); XConfiguration workflowConf = new XConfiguration(); Configuration actionConf = new Configuration(false); SharelibResolver resolver = new SharelibResolver(sharelibProperty, actionConf, workflowConf, oozieServerConfiguration, defaultValue); assertThat("Without setting anything we should've got the default value.", resolver.resolve(), is(new String[]{defaultValue})); oozieServerConfiguration.set(sharelibProperty, serverConfigSharelib); assertThat("Server-level sharelib configuration is not processed", resolver.resolve(), is(new String[]{serverConfigSharelib})); workflowConf.set(sharelibProperty, globalConfigSharelib); assertThat("Global workflow-level sharelib configuration is not processed", resolver.resolve(), is(new String[]{globalConfigSharelib})); workflowConf.set(LauncherAM.OOZIE_LAUNCHER_SHARELIB_PROPERTY, globalLauncherSharelib); assertThat("Global workflow-level sharelib configuration is not processed", resolver.resolve(), is(new String[]{globalLauncherSharelib})); actionConf.set(sharelibProperty, localConfigSharelib); assertThat("Local action-level sharelib configuration is not processed", resolver.resolve(), is(new String[]{localConfigSharelib})); actionConf.set(LauncherAM.OOZIE_LAUNCHER_SHARELIB_PROPERTY, localLauncherSharelib); assertThat("Local action-level sharelib configuration is not processed", resolver.resolve(), is(new String[]{localLauncherSharelib})); }