Search in sources :

Example 1 with ImmutableFlowClassificationRuleVantagePoint

use of org.finos.waltz.model.flow_classification_rule.ImmutableFlowClassificationRuleVantagePoint in project waltz by khartec.

the class FlowClassificationRuleResolverTest method getBestRankedIsCorrect.

@Test
public void getBestRankedIsCorrect() {
    ImmutableFlowClassificationRuleVantagePoint rank12 = ImmutableFlowClassificationRuleVantagePoint.builder().vantagePoint(vantagePoint).vantagePointRank(1).dataType(EntityReference.mkRef(EntityKind.DATA_TYPE, 20)).dataTypeRank(2).applicationId(205L).classificationCode(AuthoritativenessRatingValue.of("PRIMARY").value()).ruleId(1L).build();
    ImmutableFlowClassificationRuleVantagePoint rank22 = rank12.withVantagePointRank(2);
    ImmutableFlowClassificationRuleVantagePoint rank11 = rank12.withDataTypeRank(1);
    Optional<FlowClassificationRuleVantagePoint> bestRankedOrgUnit = getMostSpecificRanked(newArrayList(rank12, rank22));
    Optional<FlowClassificationRuleVantagePoint> bestRankedDataType = getMostSpecificRanked(newArrayList(rank12, rank11));
    assertTrue(bestRankedOrgUnit.isPresent());
    assertEquals(rank22, bestRankedOrgUnit.get());
    assertTrue(bestRankedDataType.isPresent());
    assertEquals(rank12, bestRankedDataType.get());
}
Also used : ImmutableFlowClassificationRuleVantagePoint(org.finos.waltz.model.flow_classification_rule.ImmutableFlowClassificationRuleVantagePoint) FlowClassificationRuleVantagePoint(org.finos.waltz.model.flow_classification_rule.FlowClassificationRuleVantagePoint) ImmutableFlowClassificationRuleVantagePoint(org.finos.waltz.model.flow_classification_rule.ImmutableFlowClassificationRuleVantagePoint) Test(org.junit.jupiter.api.Test)

Aggregations

FlowClassificationRuleVantagePoint (org.finos.waltz.model.flow_classification_rule.FlowClassificationRuleVantagePoint)1 ImmutableFlowClassificationRuleVantagePoint (org.finos.waltz.model.flow_classification_rule.ImmutableFlowClassificationRuleVantagePoint)1 Test (org.junit.jupiter.api.Test)1