ScenarioSimulationUtils { public static String getPlaceHolder(final boolean isInstanceAssigned, final boolean isPropertyAssigned, final FactMappingValueType valueType, final String className) { if (!isInstanceAssigned) { return ScenarioSimulationEditorConstants.INSTANCE.defineValidType(); } if (isPropertyAssigned) { if (Objects.equals(FactMappingValueType.EXPRESSION, valueType)) { return ScenarioSimulationEditorConstants.INSTANCE.insertExpression(); } if (Objects.equals(LOCALDATE_CANONICAL_NAME, className)) { return ScenarioSimulationEditorConstants.INSTANCE.dateFormatPlaceholder(); } if (Objects.equals(DMN_DATE, className)) { return ScenarioSimulationEditorConstants.INSTANCE.dmnDateFormatPlaceholder(); } return ScenarioSimulationEditorConstants.INSTANCE.insertValue(); } return ScenarioSimulationEditorConstants.INSTANCE.defineValidType(); } private  ScenarioSimulationUtils(); static String getColumnSubGroup(String columnGroup); static String getOriginalColumnGroup(String columnGroup); static boolean isSimpleJavaType(String className); static String getPlaceHolder(final boolean isInstanceAssigned,
                                        final boolean isPropertyAssigned,
                                        final FactMappingValueType valueType,
                                        final String className); static List<String> getPropertyNameElementsWithoutAlias(List<String> propertyNameElements, FactIdentifier factIdentifier); static ScenarioGridColumn getScenarioGridColumn(String instanceTitle,
                                                           String propertyTitle,
                                                           String columnId,
                                                           String columnGroup,
                                                           FactMappingType factMappingType,
                                                           ScenarioHeaderTextBoxSingletonDOMElementFactory factoryHeader,
                                                           ScenarioCellTextAreaSingletonDOMElementFactory factoryCell,
                                                           String placeHolder); static ScenarioGridColumn getScenarioGridColumn(ScenarioSimulationBuilders.HeaderBuilder headerBuilder,
                                                           ScenarioCellTextAreaSingletonDOMElementFactory factoryCell,
                                                           String placeHolder); static ScenarioSimulationBuilders.ScenarioGridColumnBuilder getScenarioGridColumnBuilder(ScenarioCellTextAreaSingletonDOMElementFactory factoryCell,
                                                                                                    ScenarioSimulationBuilders.HeaderBuilder headerBuilder,
                                                                                                    String placeHolder); static ScenarioSimulationBuilders.HeaderBuilder getHeaderBuilder(String instanceTitle,
                                                                            String propertyTitle,
                                                                            String columnId,
                                                                            String columnGroup,
                                                                            FactMappingType factMappingType,
                                                                            ScenarioHeaderTextBoxSingletonDOMElementFactory factoryHeader); static Point2D getMiddleXYCell(final GridWidget gridWidget, final GridColumn<?> column, boolean isHeader, final int uiRowIndex, final GridLayer gridLayer); static int getCellHeight(final GridWidget gridWidget, final GridColumn<?> column, boolean isHeader, final int uiRowIndex);  }
@Test public void getPlaceholder_InstanceNotAssigned() { String placeholder = ScenarioSimulationUtils.getPlaceHolder(false, false, FactMappingValueType.NOT_EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(false, true, FactMappingValueType.NOT_EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(false, false, FactMappingValueType.EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(false, true, FactMappingValueType.EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); }
@Test public void getPlaceholder_InstanceAssignedPropertyNot() { String placeholder = ScenarioSimulationUtils.getPlaceHolder(true, false, FactMappingValueType.NOT_EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(true, false, FactMappingValueType.EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.defineValidType(), placeholder); }
@Test public void getPlaceholder_InstanceAndPropertyAssigned() { String placeholder = ScenarioSimulationUtils.getPlaceHolder(true, true, FactMappingValueType.EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.insertExpression(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(true, true, FactMappingValueType.NOT_EXPRESSION, "com.Test"); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.insertValue(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(true, true, FactMappingValueType.NOT_EXPRESSION, LOCALDATE_CANONICAL_NAME); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.dateFormatPlaceholder(), placeholder); placeholder = ScenarioSimulationUtils.getPlaceHolder(true, true, FactMappingValueType.NOT_EXPRESSION, DMN_DATE); assertEquals(ScenarioSimulationEditorConstants.INSTANCE.dmnDateFormatPlaceholder(), placeholder); }