### Question:
ManagedRangerAuthorizer extends RangerNiFiAuthorizer implements ManagedAuthorizer { @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 AccessPolicyProvider getAccessPolicyProvider(); @Override String getFingerprint(); @Override void inheritFingerprint(String fingerprint); @Override void checkInheritability(String proposedFingerprint);  }### Answer:
@Test(expected = AuthorizationAccessException.class) public void testCheckInheritInvalidFingerprint() throws Exception { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); managedRangerAuthorizer.checkInheritability("not a valid fingerprint"); }
@Test public void testCheckInheritNonEmptyFingerprint() throws Exception { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); managedRangerAuthorizer.checkInheritability(NON_EMPTY_FINGERPRINT); verify(userGroupProvider, times(1)).checkInheritability(TENANT_FINGERPRINT); }
@Test(expected = UninheritableAuthorizationsException.class) public void testCheckInheritNonConfigurableUserGroupProvider() throws Exception { final UserGroupProvider userGroupProvider = mock(UserGroupProvider.class); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); managedRangerAuthorizer.checkInheritability(NON_EMPTY_FINGERPRINT); }