@Test(expected = InitializationException.class) public void initializationFailsWhenCreatingCacheFails() throws ComponentLookupException, CacheException, InitializationException { CacheManager cm = this.mocker.getInstance(CacheManager.class); when(cm.<PatientSpecificity>createNewCache(any(CacheConfiguration.class))).thenThrow( new CacheException("failed")); ((org.xwiki.component.phase.Initializable) this.mocker.getComponentUnderTest()).initialize(); }
@Override public void initialize() throws InitializationException { try { this.scorerURL = this.configuration .getProperty("phenotips.patientScoring.monarch.serviceURL", "https: CacheConfiguration config = new LRUCacheConfiguration("monarchSpecificityScore", 2048, 3600); this.cache = this.cacheManager.createNewCache(config); this.client = HttpClients.createSystem(); } catch (CacheException ex) { throw new InitializationException("Failed to create cache", ex); } }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public void initialize() throws InitializationException { try { this.scorerURL = this.configuration .getProperty("phenotips.patientScoring.monarch.serviceURL", "https: CacheConfiguration config = new LRUCacheConfiguration("monarchSpecificityScore", 2048, 3600); this.cache = this.cacheManager.createNewCache(config); this.client = HttpClients.createSystem(); } catch (CacheException ex) { throw new InitializationException("Failed to create cache", ex); } } }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public void initialize() throws InitializationException { try { this.scorerURL = this.configuration .getProperty("phenotips.patientScoring.monarch.serviceURL", "https: CacheConfiguration config = new LRUCacheConfiguration("monarchSpecificityScore", 2048, 3600); this.cache = this.cacheManager.createNewCache(config); this.client = HttpClients.createSystem(); } catch (CacheException ex) { throw new InitializationException("Failed to create cache", ex); } }  }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public void initialize() throws InitializationException { try { this.scorerURL = this.configuration .getProperty("phenotips.patientScoring.monarch.serviceURL", "https: CacheConfiguration config = new LRUCacheConfiguration("monarchSpecificityScore", 2048, 3600); this.cache = this.cacheManager.createNewCache(config); this.client = HttpClients.createSystem(); } catch (CacheException ex) { throw new InitializationException("Failed to create cache", ex); } }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient); }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public void initialize() throws InitializationException { try { this.scorerURL = this.configuration .getProperty("phenotips.patientScoring.monarch.serviceURL", "https: CacheConfiguration config = new LRUCacheConfiguration("monarchSpecificityScore", 2048, 3600); this.cache = this.cacheManager.createNewCache(config); this.client = HttpClients.createSystem(); } catch (CacheException ex) { throw new InitializationException("Failed to create cache", ex); } }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient);  }