ToSolverConfig { public SolverConfig get() { SolverConfig solverConfig = new SolverConfig(); solverConfig.setScanAnnotatedClassesConfig(new ScanAnnotatedClassesConfig()); solverConfig.setTerminationConfig(create(config.getTermination())); solverConfig.setScoreDirectorFactoryConfig(create(config.getScoreDirectorFactoryConfig())); solverConfig.setPhaseConfigList(create(config.getPhaseConfigList())); return solverConfig; } ToSolverConfig(final SolverConfigModel config); SolverConfig get();  }
@Test public void get() { ToSolverConfig toSolverConfigModel = new ToSolverConfig(getSolverConfigModel()); SolverConfig solverConfig = toSolverConfigModel.get(); TerminationConfig terminationConfig = solverConfig.getTerminationConfig(); assertEquals(Long.valueOf(1), terminationConfig.getMillisecondsSpentLimit()); assertEquals(1, terminationConfig.getTerminationConfigList().size()); assertEquals(Boolean.TRUE, terminationConfig.getTerminationConfigList().get(0).getBestScoreFeasible()); assertEquals("testKsession", solverConfig.getScoreDirectorFactoryConfig().getKsessionName()); assertEquals(2, solverConfig.getPhaseConfigList().size()); ConstructionHeuristicPhaseConfig constructionHeuristicPhaseConfig = (ConstructionHeuristicPhaseConfig) solverConfig.getPhaseConfigList().get(0); assertEquals(ConstructionHeuristicType.FIRST_FIT, constructionHeuristicPhaseConfig.getConstructionHeuristicType()); assertEquals(EntitySorterManner.DECREASING_DIFFICULTY, constructionHeuristicPhaseConfig.getEntitySorterManner()); LocalSearchPhaseConfig localSearchPhaseConfig = (LocalSearchPhaseConfig) solverConfig.getPhaseConfigList().get(1); assertEquals(LocalSearchType.TABU_SEARCH, localSearchPhaseConfig.getLocalSearchType()); }