### Question:
RangerAuthorizer implements ManagedAuthorizer, AuthorizationAuditor { @Override public void checkInheritability(String proposedFingerprint) throws AuthorizationAccessException, UninheritableAuthorizationsException { final String userGroupFingerprint = parseFingerprint(proposedFingerprint); if (StringUtils.isNotBlank(userGroupFingerprint)) { if (userGroupProvider instanceof ConfigurableUserGroupProvider) { ((ConfigurableUserGroupProvider) userGroupProvider).checkInheritability(userGroupFingerprint); } else { throw new UninheritableAuthorizationsException("User/Group fingerprint is not blank and the configured UserGroupProvider does not support fingerprinting."); } } }  @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(expected = AuthorizationAccessException.class) public void testCheckInheritInvalidFingerprint() { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); final AuthorizerConfigurationContext configurationContext = createMockConfigContext(); setup(mock(NiFiRegistryProperties.class), userGroupProvider, configurationContext); authorizer.checkInheritability("not a valid fingerprint"); }
@Test public void testCheckInheritNonEmptyFingerprint() { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); final AuthorizerConfigurationContext configurationContext = createMockConfigContext(); setup(mock(NiFiRegistryProperties.class), userGroupProvider, configurationContext); authorizer.checkInheritability(NON_EMPTY_FINGERPRINT); verify(userGroupProvider, times(1)).checkInheritability(TENANT_FINGERPRINT); }
@Test(expected = UninheritableAuthorizationsException.class) public void testCheckInheritNonConfigurableUserGroupProvider() { final UserGroupProvider userGroupProvider = mock(UserGroupProvider.class); final AuthorizerConfigurationContext configurationContext = createMockConfigContext(); setup(mock(NiFiRegistryProperties.class), userGroupProvider, configurationContext); authorizer.checkInheritability(NON_EMPTY_FINGERPRINT); }