@Test public void getSpecificityWithNoResponseReturnsNull() throws Exception { Mockito.doReturn(this.features).when(this.patient).getFeatures(); when(this.client.execute(any(HttpUriRequest.class))).thenReturn(this.response); when(this.response.getEntity()).thenReturn(this.responseEntity); when(this.responseEntity.getContent()).thenReturn(IOUtils.toInputStream("", StandardCharsets.UTF_8)); Assert.assertNull(this.mocker.getComponentUnderTest().getSpecificity(this.patient)); }
@Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { result = this.cache.get(key); } } return result; }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { result = this.cache.get(key); } } return result; } }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { result = this.cache.get(key); } } return result; }  }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { result = this.cache.get(key); } } return result; }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient); }
MonarchPatientScorer implements PatientScorer, Initializable { @Override public PatientSpecificity getSpecificity(Patient patient) { String key = getCacheKey(patient); PatientSpecificity result = this.cache.get(key); if (result == null) { double score = getScore(patient); if (score != -1.0) { result = this.cache.get(key); } } return result; }  @Override void initialize(); @Override PatientSpecificity getSpecificity(Patient patient); @Override double getScore(Patient patient);  }