@Test public void testSaslAuthSchemeHeadless(){ final NiFiProperties nifiProperties; final CuratorACLProviderFactory factory; otherProps.put("nifi.zookeeper.kerberos.removeHostFromPrincipal", "true"); otherProps.put("nifi.zookeeper.kerberos.removeRealmFromPrincipal", "true"); otherProps.put("nifi.kerberos.service.principal","nifi@REALM.COM"); nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps); factory = new CuratorACLProviderFactory(); ZooKeeperClientConfig config = ZooKeeperClientConfig.createConfig(nifiProperties); ACLProvider provider = factory.create(config); assertFalse(provider instanceof DefaultACLProvider); List<ACL> acls = provider.getDefaultAcl(); assertNotNull(acls); assertEquals(acls.get(0).getId().toString().trim(),"'sasl,'nifi"); }
public ACLProvider create(ZooKeeperClientConfig config){ return StringUtils.equalsIgnoreCase(config.getAuthType(),SASL_AUTH_SCHEME) ? new SaslACLProvider(config) : new DefaultACLProvider(); }
CuratorACLProviderFactory { public ACLProvider create(ZooKeeperClientConfig config){ return StringUtils.equalsIgnoreCase(config.getAuthType(),SASL_AUTH_SCHEME) ? new SaslACLProvider(config) : new DefaultACLProvider(); } }
CuratorACLProviderFactory { public ACLProvider create(ZooKeeperClientConfig config){ return StringUtils.equalsIgnoreCase(config.getAuthType(),SASL_AUTH_SCHEME) ? new SaslACLProvider(config) : new DefaultACLProvider(); }  }
CuratorACLProviderFactory { public ACLProvider create(ZooKeeperClientConfig config){ return StringUtils.equalsIgnoreCase(config.getAuthType(),SASL_AUTH_SCHEME) ? new SaslACLProvider(config) : new DefaultACLProvider(); }  ACLProvider create(ZooKeeperClientConfig config); }
CuratorACLProviderFactory { public ACLProvider create(ZooKeeperClientConfig config){ return StringUtils.equalsIgnoreCase(config.getAuthType(),SASL_AUTH_SCHEME) ? new SaslACLProvider(config) : new DefaultACLProvider(); }  ACLProvider create(ZooKeeperClientConfig config); static final String SASL_AUTH_SCHEME; }