@Test public void testGetConstraintTextWhenItemDefinitionDoesNotHaveAllowedValues() { final ItemDefinition itemDefinition = mock(ItemDefinition.class); final String expectedText = ""; final String actualText = utils.getConstraintText(itemDefinition); assertEquals(expectedText, actualText); }
public String getConstraintText(final ItemDefinition itemDefinition) { return Optional .ofNullable(itemDefinition.getAllowedValues()) .map(UnaryTests::getText) .orElse(new Text()) .getValue(); }
ItemDefinitionUtils { public String getConstraintText(final ItemDefinition itemDefinition) { return Optional .ofNullable(itemDefinition.getAllowedValues()) .map(UnaryTests::getText) .orElse(new Text()) .getValue(); } }
ItemDefinitionUtils { public String getConstraintText(final ItemDefinition itemDefinition) { return Optional .ofNullable(itemDefinition.getAllowedValues()) .map(UnaryTests::getText) .orElse(new Text()) .getValue(); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); }
ItemDefinitionUtils { public String getConstraintText(final ItemDefinition itemDefinition) { return Optional .ofNullable(itemDefinition.getAllowedValues()) .map(UnaryTests::getText) .orElse(new Text()) .getValue(); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); Optional<ItemDefinition> findByName(final String name); List<ItemDefinition> all(); void addItemDefinitions(final List<ItemDefinition> newItemDefinitions); String getConstraintText(final ItemDefinition itemDefinition); QName normaliseTypeRef(final QName typeRef); }
ItemDefinitionUtils { public String getConstraintText(final ItemDefinition itemDefinition) { return Optional .ofNullable(itemDefinition.getAllowedValues()) .map(UnaryTests::getText) .orElse(new Text()) .getValue(); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); Optional<ItemDefinition> findByName(final String name); List<ItemDefinition> all(); void addItemDefinitions(final List<ItemDefinition> newItemDefinitions); String getConstraintText(final ItemDefinition itemDefinition); QName normaliseTypeRef(final QName typeRef);  }