@Test public void testMakeAllowedValuesWhenDataTypeConstraintIsBlank() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(dataType.getConstraint()).thenReturn(""); final UnaryTests actualAllowedValues = handler.makeAllowedValues(dataType, itemDefinition); assertNull(actualAllowedValues); }
UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); }
ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); } }
ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); } @Inject  ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
                                       final ItemDefinitionUtils itemDefinitionUtils,
                                       final PropertiesPanelNotifier panelNotifier,
                                       final Event<DataTypeChangedEvent> dataTypeChangedEvent); }
ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); } @Inject  ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
                                       final ItemDefinitionUtils itemDefinitionUtils,
                                       final PropertiesPanelNotifier panelNotifier,
                                       final Event<DataTypeChangedEvent> dataTypeChangedEvent); void update(final DataType dataType,
                       final ItemDefinition itemDefinition); }
ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); } @Inject  ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
                                       final ItemDefinitionUtils itemDefinitionUtils,
                                       final PropertiesPanelNotifier panelNotifier,
                                       final Event<DataTypeChangedEvent> dataTypeChangedEvent); void update(final DataType dataType,
                       final ItemDefinition itemDefinition);  }