Search in sources :

Example 6 with LabelValue

use of com.thinkbiganalytics.rest.model.LabelValue in project kylo by Teradata.

the class TestPreconditionPolicyTransform method testFeedExecutedSinceFeed.

@Test
public void testFeedExecutedSinceFeed() throws IOException {
    String dependentUponFeed = "category.feed";
    String currentFeed = "currentCategory.currentFeeda";
    FeedExecutedSinceFeeds feedExecutedSinceFeed = new FeedExecutedSinceFeeds(currentFeed, dependentUponFeed);
    PreconditionRule uiModel = PreconditionAnnotationTransformer.instance().toUIModel(feedExecutedSinceFeed);
    List<LabelValue> values = new ArrayList<>();
    values.add(new LabelValue("Label1", "Value1"));
    values.add(new LabelValue("Label2", "Value2"));
    uiModel.getProperty("Dependent Feeds").setValues(values);
    FeedExecutedSinceFeeds convertedPolicy = fromUI(uiModel, FeedExecutedSinceFeeds.class);
    Assert.assertEquals(currentFeed, convertedPolicy.getSinceCategoryAndFeedName());
    Assert.assertEquals(dependentUponFeed, convertedPolicy.getCategoryAndFeeds());
    Set<ObligationGroup> preconditionGroups = convertedPolicy.buildPreconditionObligations();
}
Also used : LabelValue(com.thinkbiganalytics.rest.model.LabelValue) ArrayList(java.util.ArrayList) PreconditionRule(com.thinkbiganalytics.policy.rest.model.PreconditionRule) ObligationGroup(com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup) Test(org.junit.Test)

Aggregations

LabelValue (com.thinkbiganalytics.rest.model.LabelValue)6 ArrayList (java.util.ArrayList)4 FeedSummary (com.thinkbiganalytics.feedmgr.rest.model.FeedSummary)2 FieldRuleProperty (com.thinkbiganalytics.policy.rest.model.FieldRuleProperty)2 ServiceLevelAgreementActionUiConfigurationItem (com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementActionUiConfigurationItem)1 ObligationGroup (com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup)1 PreconditionRule (com.thinkbiganalytics.policy.rest.model.PreconditionRule)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Test (org.junit.Test)1