MisoServiceManager { public static MisoServiceManager buildWithDefaults(JdbcTemplate jdbcTemplate, SessionFactory sessionFactory, String username) throws IOException { MisoServiceManager m = new MisoServiceManager(jdbcTemplate, sessionFactory); m.setAllDefaults(); User migrationUser = m.getUserByLoginNameInTransaction(m.getSecurityStore(), username); if (migrationUser == null) throw new IllegalArgumentException("User '" + username + "' not found"); m.setUpSecurityContext(migrationUser); m.setAuthorizationManagerWithUser(migrationUser); return m; } MisoServiceManager(JdbcTemplate jdbcTemplate, SessionFactory sessionFactory); static MisoServiceManager buildWithDefaults(JdbcTemplate jdbcTemplate, SessionFactory sessionFactory, String username); static MisoServiceManager buildWithDefaults(JdbcTemplate jdbcTemplate, SessionFactory sessionFactory, User migrationUser); User getUserByLoginNameInTransaction(HibernateSecurityDao securityStore, String username); void setUpSecurityContext(User migrationUser); NamingSchemeHolder getNamingSchemeHolder(); MigrationAuthorizationManager getAuthorizationManager(); void setAuthorizationManager(MigrationAuthorizationManager authorizationManager); void setAuthorizationManagerWithUser(User migrationUser); DefaultProjectService getProjectService(); void setProjectService(DefaultProjectService projectService); void setDefaultProjectService(); HibernateSecurityDao getSecurityStore(); void setSecurityStore(HibernateSecurityDao securityStore); void setDefaultSecurityStore(); LocalSecurityManager getSecurityManager(); void setSecurityManager(LocalSecurityManager securityManager); void setDefaultSecurityManager(); DefaultUserService getUserService(); void setUserService(DefaultUserService userService); void setDefaultUserService(); HibernateProjectDao getProjectDao(); void setProjectDao(HibernateProjectDao projectDao); void setDefaultProjectDao(); HibernateSampleClassDao getSampleClassDao(); void setSampleClassDao(HibernateSampleClassDao sampleClassDao); void setDefaultSampleClassDao(); DefaultSampleClassService getSampleClassService(); void setSampleClassService(DefaultSampleClassService sampleClassService); void setDefaultSampleClassService(); DefaultSampleService getSampleService(); void setSampleService(DefaultSampleService sampleService); void setDefaultSampleService(); HibernateSampleDao getSampleDao(); void setSampleDao(HibernateSampleDao sampleDao); void setDefaultSampleDao(); HibernateChangeLogDao getChangeLogDao(); void setChangeLogDao(HibernateChangeLogDao changeLogDao); void setDefaultChangeLogDao(); HibernateSampleQcDao getSampleQcDao(); void setSampleQcDao(HibernateSampleQcDao sampleQcDao); void setDefaultSampleQcDao(); HibernateLibraryDao getLibraryDao(); void setLibraryDao(HibernateLibraryDao libraryDao); void setDefaultLibraryDao(); DefaultLibraryService getLibraryService(); void setLibraryService(DefaultLibraryService libraryService); void setDefaultLibraryService(); HibernateLibraryQcDao getLibraryQcDao(); void setLibraryQcDao(HibernateLibraryQcDao libraryQcDao); void setDefaultLibraryQcDao(); HibernateLibraryAliquotDao getLibraryAliquotDao(); void setLibraryAliquotDao(HibernateLibraryAliquotDao libraryAliquotDao); void setDefaultLibraryAliquotDao(); DefaultLibraryAliquotService getLibraryAliquotService(); void setLibraryAliquotService(DefaultLibraryAliquotService libraryAliquotService); void setDefaultLibraryAliquotService(); HibernateTargetedSequencingDao getTargetedSequencingDao(); void setTargetedSequencingDao(HibernateTargetedSequencingDao targetedSequencingDao); void setDefaultTargetedSequencingDao(); HibernatePoolDao getPoolDao(); void setPoolDao(HibernatePoolDao poolDao); void setDefaultPoolDao(); DefaultPoolService getPoolService(); void setPoolService(DefaultPoolService service); void setDefaultPoolService(); HibernateExperimentDao getExperimentDao(); void setExperimentDao(HibernateExperimentDao experimentDao); void setDefaultExperimentDao(); HibernateKitDao getKitDao(); void setKitDao(HibernateKitDao kitDao); void setDefaultKitDao(); HibernateInstrumentModelDao getPlatformDao(); void setInstrumentModelDao(HibernateInstrumentModelDao instrumentModelDao); void setDefaultInstrumentModelDao(); HibernateStudyDao getStudyDao(); void setStudyDao(HibernateStudyDao studyDao); void setDefaultStudyDao(); HibernateRunDao getRunDao(); void setRunDao(HibernateRunDao runDao); void setDefaultRunDao(); HibernateSequencerPartitionContainerDao getSequencerPartitionContainerDao(); void setSequencerPartitionContainerDao(HibernateSequencerPartitionContainerDao sequencerPartitionContainerDao); void setDefaultSequencerPartitionContainerDao(); HibernateInstrumentDao getInstrumentDao(); void setInstrumentDao(HibernateInstrumentDao instrumentDao); void setDefaultInstrumentDao(); HibernateBoxDao getBoxDao(); void setBoxDao(HibernateBoxDao boxDao); void setDefaultBoxDao(); DefaultLabService getLabService(); void setLabService(DefaultLabService labService); void setDefaultLabService(); HibernateLabDao getLabDao(); void setLabDao(HibernateLabDao labDao); void setDefaultLabDao(); HibernateInstituteDao getInstituteDao(); void setInstituteDao(HibernateInstituteDao instituteDao); void setDefaultInstituteDao(); HibernateDetailedQcStatusDao getDetailedQcStatusDao(); void setDetailedQcStatusDao(HibernateDetailedQcStatusDao detailedQcStatus); void setDefaultDetailedQcStatusDao(); HibernateSubprojectDao getSubprojectDao(); void setSubprojectDao(HibernateSubprojectDao subprojectDao); void setDefaultSubprojectDao(); HibernateTissueOriginDao getTissueOriginDao(); void setTissueOriginDao(HibernateTissueOriginDao tissueOriginDao); void setDefaultTissueOriginDao(); HibernateTissueTypeDao getTissueTypeDao(); void setTissueTypeDao(HibernateTissueTypeDao tissueTypeDao); void setDefaultTissueTypeDao(); HibernateSamplePurposeDao getSamplePurposeDao(); void setSamplePurposeDao(HibernateSamplePurposeDao samplePurposeDao); void setDefaultSamplePurposeDao(); HibernateTissueMaterialDao getTissueMaterialDao(); void setTissueMaterialDao(HibernateTissueMaterialDao tissueMaterialDao); void setDefaultTissueMaterialDao(); DefaultSampleNumberPerProjectService getSampleNumberPerProjectService(); void setSampleNumberPerProjectService(DefaultSampleNumberPerProjectService sampleNumberPerProjectService); void setDefaultSampleNumberPerProjectService(); HibernateSampleNumberPerProjectDao getSampleNumberPerProjectDao(); void setSampleNumberPerProjectDao(HibernateSampleNumberPerProjectDao sampleNumberPerProjectDao); void setDefaultSampleNumberPerProjectDao(); DefaultSampleValidRelationshipService getSampleValidRelationshipService(); void setSampleValidRelationshipService(DefaultSampleValidRelationshipService sampleValidRelationshipService); void setDefaultSampleValidRelationshipService(); DefaultStudyService getStudyService(); void setStudyService(DefaultStudyService studyService); void setDefaultStudyService(); DefaultReferenceGenomeService getReferenceGenomeService(); void setReferenceGenomeService(DefaultReferenceGenomeService referenceGenomeService); void setDefaultReferenceGenomeService(); HibernateReferenceGenomeDao getReferenceGenomeDao(); void setReferenceGenomeDao(HibernateReferenceGenomeDao referenceGenomeDao); void setDefaultReferenceGenomeDao(); HibernateSampleValidRelationshipDao getSampleValidRelationshipDao(); void setSampleValidRelationshipDao(HibernateSampleValidRelationshipDao sampleValidRelationshipDao); void setDefaultSampleValidRelationshipDao(); HibernateLibraryDesignDao getLibraryDesignDao(); void setLibraryDesignDao(HibernateLibraryDesignDao libraryDesignDao); void setDefaultLibraryDesignDao(); HibernateLibraryDesignCodeDao getLibraryDesignCodeDao(); void setLibraryDesignCodeDao(HibernateLibraryDesignCodeDao libraryDesignCodeDao); void setDefaultLibraryDesignCodeDao(); HibernateIndexDao getIndexDao(); void setIndexDao(HibernateIndexDao indexDao); void setDefaultIndexDao(); HibernateSequencingParametersDao getSequencingParametersDao(); void setSequencingParametersDao(HibernateSequencingParametersDao sequencingParametersDao); void setDefaultSequencingParametersDao(); HibernatePoolableElementViewDao getPoolableElementViewDao(); void setPoolableElementViewDao(HibernatePoolableElementViewDao dao); void setDefaultPoolableElementViewDao(); DefaultPoolableElementViewService getPoolableElementViewService(); void setPoolableElementViewService(DefaultPoolableElementViewService service); void setDefaultPoolableElementViewService(); DefaultRunService getRunService(); void setRunService(DefaultRunService service); void setDefaultRunService(); DefaultContainerService getContainerService(); void setContainerService(DefaultContainerService service); void setDefaultContainerService(); DefaultInstrumentModelService getInstrumentModelService(); void setInstrumentModelService(DefaultInstrumentModelService service); void setDefaultInstrumentModelService(); DefaultInstrumentService getInstrumentService(); void setInstrumentService(DefaultInstrumentService service); void setDefaultInstrumentService(); DefaultLibraryDesignService getLibraryDesignService(); void setLibraryDesignService(DefaultLibraryDesignService service); void setDefaultLibraryDesignService(); DefaultLibraryDesignCodeService getLibraryDesignCodeService(); void setLibraryDesignCodeService(DefaultLibraryDesignCodeService service); void setDefaultLibraryDesignCodeService(); DefaultIndexService getIndexService(); void setIndexService(DefaultIndexService service); void setDefaultIndexService(); DefaultKitDescriptorService getKitDescriptorService(); void setKitDescriptorService(DefaultKitDescriptorService service); void setDefaultKitDescriptorService(); DefaultKitService getKitService(); void setKitService(DefaultKitService service); void setDefaultKitService(); DefaultTargetedSequencingService getTargetedSequencingService(); void setTargetedSequencingService(DefaultTargetedSequencingService service); void setDefaultTargetedSequencingService(); DefaultChangeLogService getChangeLogService(); void setChangeLogService(DefaultChangeLogService service); void setDefaultChangeLogService(); DefaultSequencingParametersService getSequencingParametersService(); void setSequencingParametersService(DefaultSequencingParametersService service); void setDefaultSequencingParametersService(); DefaultSequencingOrderService getSequencingOrderService(); void setSequencingOrderService(DefaultSequencingOrderService service); void setDefaultSequencingOrderService(); HibernateSequencingOrderDao getSequencingOrderDao(); void setSequencingOrderDao(HibernateSequencingOrderDao dao); void setDefaultSequencingOrderDao(); DefaultExperimentService getExperimentService(); void setExperimentService(DefaultExperimentService svc); void setDefaultExperimentService(); DefaultBoxService getBoxService(); void setBoxService(DefaultBoxService service); void setDefaultBoxService(); DefaultQualityControlService getQualityControlService(); void setQualityControlService(DefaultQualityControlService qualityControlService); void setDefaultQualityControlService(); HibernateQcTypeDao getQcTypeDao(); void setQcTypeDao(HibernateQcTypeDao qcTypeDao); void setDefaultQcTypeDao(); HibernateDeletionDao getDeletionStore(); void setDeletionStore(HibernateDeletionDao dao); void setDefaultDeletionStore(); HibernateBoxUseDao getBoxUseDao(); void setBoxUseDao(HibernateBoxUseDao dao); void setDefaultBoxUseDao(); DefaultBoxUseService getBoxUseService(); void setBoxUseService(DefaultBoxUseService service); void setDefaultBoxUseService(); HibernateBoxSizeDao getBoxSizeDao(); void setBoxSizeDao(HibernateBoxSizeDao dao); void setDefaultBoxSizeDao(); DefaultBoxSizeService getBoxSizeService(); void setBoxSizeService(DefaultBoxSizeService service); void setDefaultBoxSizeService(); HibernateStudyTypeDao getStudyTypeDao(); void setStudyTypeDao(HibernateStudyTypeDao dao); void setDefaultStudyTypeDao(); DefaultStudyTypeService getStudyTypeService(); void setStudyTypeService(DefaultStudyTypeService service); void setDefaultStudyTypeService(); HibernateLibrarySelectionDao getLibrarySelectionDao(); void setLibrarySelectionDao(HibernateLibrarySelectionDao dao); void setDefaultLibrarySelectionDao(); DefaultLibrarySelectionService getLibrarySelectionService(); void setLibrarySelectionService(DefaultLibrarySelectionService service); void setDefaultLibrarySelectionService(); HibernateLibraryStrategyDao getLibraryStrategyDao(); void setLibraryStrategyDao(HibernateLibraryStrategyDao dao); void setDefaultLibraryStrategyDao(); DefaultLibraryStrategyService getLibraryStrategyService(); void setLibraryStrategyService(DefaultLibraryStrategyService service); void setDefaultLibraryStrategyService();  }
@Test public void testBuildWithDefaults() throws IOException { MisoServiceManager sut = MisoServiceManager.buildWithDefaults(null, null, new UserImpl()); assertNotNull(sut); SampleService sampleService = sut.getSampleService(); assertNotNull(sampleService); assertNotNull(sampleService.getAuthorizationManager()); assertNotNull(sampleService.getDeletionStore()); }