Search in sources :

Example 1 with PredicateImpl

use of com.thinkbiganalytics.guava.PredicateImpl in project kylo by Teradata.

the class TestStandardizationTransform method testUiCreation.

@Test
public void testUiCreation() {
    List<FieldStandardizationRule> standardizationRules = AvailablePolicies.discoverStandardizationRules();
    FieldStandardizationRule defaultValue = Iterables.tryFind(standardizationRules, new PredicateImpl<FieldStandardizationRule>() {

        @Override
        public boolean test(FieldStandardizationRule fieldStandardizationRule) {
            return fieldStandardizationRule.getName().equalsIgnoreCase("Default Value");
        }
    }).orNull();
    defaultValue.getProperty("Default Value").setValue("a new default value");
    DefaultValueStandardizer convertedPolicy = fromUI(defaultValue, DefaultValueStandardizer.class);
    Assert.assertEquals("a new default value", convertedPolicy.getDefaultStr());
}
Also used : DefaultValueStandardizer(com.thinkbiganalytics.policy.standardization.DefaultValueStandardizer) PredicateImpl(com.thinkbiganalytics.guava.PredicateImpl) FieldStandardizationRule(com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule) Test(org.junit.Test)

Aggregations

PredicateImpl (com.thinkbiganalytics.guava.PredicateImpl)1 FieldStandardizationRule (com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule)1 DefaultValueStandardizer (com.thinkbiganalytics.policy.standardization.DefaultValueStandardizer)1 Test (org.junit.Test)1