@Test public void testShouldInclude() { KerberosIdentityDescriptor identityDescriptor = createFromJSON(); Map<String, Object> context = new TreeMap<String, Object>(); context.put("services", new HashSet<String>(Arrays.asList("HIVE", "HDFS", "ZOOKEEPER"))); Assert.assertTrue(identityDescriptor.shouldInclude(context)); context.put("services", new HashSet<String>(Arrays.asList("NOT_HIVE", "HDFS", "ZOOKEEPER"))); Assert.assertFalse(identityDescriptor.shouldInclude(context)); }
public boolean shouldInclude(Map<String, Object> context) { return (this.when == null) || this.when.evaluate(context); }
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { public boolean shouldInclude(Map<String, Object> context) { return (this.when == null) || this.when.evaluate(context); } }
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { public boolean shouldInclude(Map<String, Object> context) { return (this.when == null) || this.when.evaluate(context); } KerberosIdentityDescriptor(String name, String reference, KerberosPrincipalDescriptor principal, KerberosKeytabDescriptor keytab, Predicate when);  KerberosIdentityDescriptor(Map<?, ?> data); }
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { public boolean shouldInclude(Map<String, Object> context) { return (this.when == null) || this.when.evaluate(context); } KerberosIdentityDescriptor(String name, String reference, KerberosPrincipalDescriptor principal, KerberosKeytabDescriptor keytab, Predicate when);  KerberosIdentityDescriptor(Map<?, ?> data); String getReference(); void setReference(String reference); KerberosPrincipalDescriptor getPrincipalDescriptor(); void setPrincipalDescriptor(KerberosPrincipalDescriptor principal); KerberosKeytabDescriptor getKeytabDescriptor(); void setKeytabDescriptor(KerberosKeytabDescriptor keytab); String getPassword(); void setPassword(String password); Predicate getWhen(); void setWhen(Predicate when); boolean shouldInclude(Map<String, Object> context); void update(KerberosIdentityDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object); }
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { public boolean shouldInclude(Map<String, Object> context) { return (this.when == null) || this.when.evaluate(context); } KerberosIdentityDescriptor(String name, String reference, KerberosPrincipalDescriptor principal, KerberosKeytabDescriptor keytab, Predicate when);  KerberosIdentityDescriptor(Map<?, ?> data); String getReference(); void setReference(String reference); KerberosPrincipalDescriptor getPrincipalDescriptor(); void setPrincipalDescriptor(KerberosPrincipalDescriptor principal); KerberosKeytabDescriptor getKeytabDescriptor(); void setKeytabDescriptor(KerberosKeytabDescriptor keytab); String getPassword(); void setPassword(String password); Predicate getWhen(); void setWhen(Predicate when); boolean shouldInclude(Map<String, Object> context); void update(KerberosIdentityDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }