### Question:
ManagedRangerAuthorizer extends RangerNiFiAuthorizer implements ManagedAuthorizer { @Override public String getFingerprint() throws AuthorizationAccessException { final StringWriter out = new StringWriter(); try { final DocumentBuilder documentBuilder = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder(); final Document document = documentBuilder.newDocument(); final Element managedRangerAuthorizationsElement = document.createElement("managedRangerAuthorizations"); document.appendChild(managedRangerAuthorizationsElement); final Element userGroupProviderElement = document.createElement(USER_GROUP_PROVIDER_ELEMENT); managedRangerAuthorizationsElement.appendChild(userGroupProviderElement); if (userGroupProvider instanceof ConfigurableUserGroupProvider) { userGroupProviderElement.appendChild(document.createTextNode(((ConfigurableUserGroupProvider) userGroupProvider).getFingerprint())); } final Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform(new DOMSource(document), new StreamResult(out)); } catch (ParserConfigurationException | TransformerException e) { throw new AuthorizationAccessException("Unable to generate fingerprint", e); } return out.toString(); }  @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 public void testNonConfigurableFingerPrint() throws Exception { final UserGroupProvider userGroupProvider = mock(UserGroupProvider.class); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); Assert.assertEquals(EMPTY_FINGERPRINT, managedRangerAuthorizer.getFingerprint()); }
@Test public void testConfigurableEmptyFingerPrint() throws Exception { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); when(userGroupProvider.getFingerprint()).thenReturn(""); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); Assert.assertEquals(EMPTY_FINGERPRINT, managedRangerAuthorizer.getFingerprint()); }
@Test public void testConfigurableFingerPrint() throws Exception { final ConfigurableUserGroupProvider userGroupProvider = mock(ConfigurableUserGroupProvider.class); when(userGroupProvider.getFingerprint()).thenReturn(TENANT_FINGERPRINT); final ManagedRangerAuthorizer managedRangerAuthorizer = getStandardManagedAuthorizer(userGroupProvider); Assert.assertEquals(NON_EMPTY_FINGERPRINT, managedRangerAuthorizer.getFingerprint()); }