AnalysisFactory { public AnalysisRunner getAnalysisRunner(GenomeAssembly genomeAssembly, AnalysisMode analysisMode) { GenomeAnalysisService genomeAnalysisService = genomeAnalysisServiceProvider.get(genomeAssembly); switch (analysisMode) { case FULL: return new SimpleAnalysisRunner(genomeAnalysisService); case PASS_ONLY: default: return new PassOnlyAnalysisRunner(genomeAnalysisService); } } @Autowired  AnalysisFactory(GenomeAnalysisServiceProvider genomeAnalysisServiceProvider, PriorityFactory priorityFactory, OntologyService ontologyService); AnalysisRunner getAnalysisRunner(GenomeAssembly genomeAssembly, AnalysisMode analysisMode); AnalysisBuilder getAnalysisBuilder();  }
@Test public void testCanMakeFullAnalysisRunner() { AnalysisRunner analysisRunner = instance.getAnalysisRunner(GenomeAssembly.HG19, AnalysisMode.FULL); assertThat(analysisRunner, instanceOf(SimpleAnalysisRunner.class)); }
@Test public void testCanMakePassOnlyAnalysisRunner() { AnalysisRunner analysisRunner = instance.getAnalysisRunner(GenomeAssembly.HG19, AnalysisMode.PASS_ONLY); assertThat(analysisRunner, instanceOf(PassOnlyAnalysisRunner.class)); }
@Test public void testGetAnalysisRunnerThrowsExceptionWhenUnsupportedGenomeAssemblyIsSpecified() { assertThrows(UnsupportedGenomeAssemblyException.class, ()-> instance.getAnalysisRunner(GenomeAssembly.HG38, AnalysisMode.FULL)); }