### Question:
RangerAuthorizer implements ManagedAuthorizer, AuthorizationAuditor { @Override public void onConfigured(AuthorizerConfigurationContext configurationContext) throws SecurityProviderCreationException { final String userGroupProviderKey = configurationContext.getProperty(USER_GROUP_PROVIDER).getValue(); if (StringUtils.isEmpty(userGroupProviderKey)) { throw new SecurityProviderCreationException(USER_GROUP_PROVIDER + " must be specified."); } userGroupProvider = userGroupProviderLookup.getUserGroupProvider(userGroupProviderKey); if (userGroupProvider == null) { throw new SecurityProviderCreationException(String.format("Unable to locate configured User Group Provider: %s", userGroupProviderKey)); } try { if (rangerPlugin == null) { logger.info("initializing base plugin"); final String serviceType = getConfigValue(configurationContext, RANGER_SERVICE_TYPE_PROP, DEFAULT_SERVICE_TYPE); final String appId = getConfigValue(configurationContext, RANGER_APP_ID_PROP, DEFAULT_APP_ID); rangerPlugin = createRangerBasePlugin(serviceType, appId); final RangerPluginConfig pluginConfig = rangerPlugin.getConfig(); final PropertyValue securityConfigValue = configurationContext.getProperty(RANGER_SECURITY_PATH_PROP); addRequiredResource(RANGER_SECURITY_PATH_PROP, securityConfigValue, pluginConfig); final PropertyValue auditConfigValue = configurationContext.getProperty(RANGER_AUDIT_PATH_PROP); addRequiredResource(RANGER_AUDIT_PATH_PROP, auditConfigValue, pluginConfig); boolean rangerKerberosEnabled = Boolean.valueOf(getConfigValue(configurationContext, RANGER_KERBEROS_ENABLED_PROP, Boolean.FALSE.toString())); if (rangerKerberosEnabled) { final Configuration securityConf = new Configuration(); securityConf.set(HADOOP_SECURITY_AUTHENTICATION, KERBEROS_AUTHENTICATION); UserGroupInformation.setConfiguration(securityConf); final String registryPrincipal = registryProperties.getKerberosServicePrincipal(); final String registryKeytab = registryProperties.getKerberosServiceKeytabLocation(); if (StringUtils.isBlank(registryPrincipal) || StringUtils.isBlank(registryKeytab)) { throw new SecurityProviderCreationException("Principal and Keytab must be provided when Kerberos is enabled"); } UserGroupInformation.loginUserFromKeytab(registryPrincipal.trim(), registryKeytab.trim()); } rangerPlugin.init(); defaultAuditHandler = new RangerDefaultAuditHandler(); rangerAdminIdentity = getConfigValue(configurationContext, RANGER_ADMIN_IDENTITY_PROP, null); } else { logger.info("base plugin already initialized"); } } catch (Throwable t) { throw new SecurityProviderCreationException("Error creating RangerBasePlugin", t); } }  @Override void initialize(AuthorizerInitializationContext initializationContext); @Override void onConfigured(AuthorizerConfigurationContext configurationContext); @Override AuthorizationResult authorize(final AuthorizationRequest request); @Override void auditAccessAttempt(final AuthorizationRequest request, final AuthorizationResult result); @Override void preDestruction(); @AuthorizerContext void setRegistryProperties(final NiFiRegistryProperties properties); @Override String getFingerprint(); @Override void inheritFingerprint(String fingerprint); @Override void checkInheritability(String proposedFingerprint); @Override AccessPolicyProvider getAccessPolicyProvider();  }### Answer:
@Test public void testOnConfigured() { setup(mock(NiFiRegistryProperties.class), mock(UserGroupProvider.class), createMockConfigContext()); verify(rangerBasePlugin, times(1)).init(); assertEquals(appId, authorizer.mockRangerBasePlugin.getAppId()); assertEquals(serviceType, authorizer.mockRangerBasePlugin.getServiceType()); }