PlannerDataObjectEditor extends ObjectEditor implements PlannerDataObjectEditorView.Presenter { @Override public void onPlanningSolutionScoreTypeChange() { updatePlanningScoreProperty(view.getPlanningSolutionScoreType()); } @Inject  PlannerDataObjectEditor(PlannerDataObjectEditorView view,
                                   DomainHandlerRegistry handlerRegistry,
                                   Event<DataModelerEvent> dataModelerEvent,
                                   DataModelCommandBuilder commandBuilder,
                                   TranslationService translationService,
                                   Caller<ComparatorDefinitionService> comparatorDefinitionService,
                                   Caller<AssetsUsageService> assetsUsageServiceCaller); @Override Widget asWidget(); @Override String getName(); @Override String getDomainName(); @Override void clear(); @Override void objectPropertyPathChanged(List<ObjectPropertyPath> objectPropertyPaths,
                                          boolean itemsRemoved); @Override void removeComparatorDefinition(DataObject dataObject,
                                           boolean resetPlanningEntityAnnotation); @Override void onNotInPlanningChange(); @Override void onPlanningEntityChange(); @Override void onPlanningSolutionChange(); @Override void onPlanningSolutionScoreTypeChange(); @Override void onPlanningSolutionBendableScoreHardLevelsSizeChange(); @Override void onPlanningSolutionBendableScoreSoftLevelsSizeChange();  }
@Test public void onPlanningSolutionScoreTypeChange() { PlannerDataObjectEditor objectEditor = createObjectEditor(); objectEditor.onContextChange(context); Mockito.reset(view); when(view.getPlanningSolutionScoreType()).thenReturn(BendableScore.class.getName()); context.getAnnotationDefinitions().put(PlannerDomainAnnotations.PLANNING_SCORE_ANNOTATION, mock(AnnotationDefinition.class)); context.getAnnotationDefinitions().put(PlannerDomainAnnotations.JAXB_XML_ROOT_ELEMENT, mock(AnnotationDefinition.class)); context.getAnnotationDefinitions().put(PlannerDomainAnnotations.JAXB_XML_ACCESSOR_TYPE, mock(AnnotationDefinition.class)); context.getAnnotationDefinitions().put(PlannerDomainAnnotations.JAXB_XML_JAVA_TYPE_ADAPTER_ANNOTATION, mock(AnnotationDefinition.class)); context.getAnnotationDefinitions().put(Generated.class.getName(), mock(AnnotationDefinition.class)); objectEditor.onPlanningSolutionScoreTypeChange(); DataObject dataObject = context.getDataObject(); ObjectProperty scoreObjectProperty = dataObject.getProperty("score"); assertNotNull(scoreObjectProperty); assertEquals(BendableScore.class.getName(), scoreObjectProperty.getClassName()); }