@Test public void indexThrowsSolrException() throws IOException, SolrServerException { Set<Feature> patientFeatures = new HashSet<>(); Feature testFeature = mock(Feature.class); patientFeatures.add(testFeature); DocumentReference reporterReference = new DocumentReference("xwiki", "XWiki", "user"); EntityAccess entityAccess = mock(DefaultEntityAccess.class); Visibility patientVisibility = new PublicVisibility(); doReturn(this.patientDocReference).when(this.patient).getDocumentReference(); doReturn(reporterReference).when(this.patient).getReporter(); doReturn(patientFeatures).when(this.patient).getFeatures(); doReturn(true).when(testFeature).isPresent(); doReturn("phenotype").when(testFeature).getType(); doReturn("id").when(testFeature).getId(); doReturn(entityAccess).when(this.permissions).getEntityAccess(this.patient); doReturn(patientVisibility).when(entityAccess).getVisibility(); doThrow(new SolrServerException("Error while adding SolrInputDocument")).when(this.server) .add(any(SolrInputDocument.class)); this.patientIndexer.index(this.patient); verify(this.logger).warn("Failed to perform Solr search: {}", "Error while adding SolrInputDocument"); }
@Override public void index(Patient patient) { this.internalIndex(patient, true); }
SolrPatientIndexer implements PatientIndexer, Initializable { @Override public void index(Patient patient) { this.internalIndex(patient, true); } }
SolrPatientIndexer implements PatientIndexer, Initializable { @Override public void index(Patient patient) { this.internalIndex(patient, true); }  }
SolrPatientIndexer implements PatientIndexer, Initializable { @Override public void index(Patient patient) { this.internalIndex(patient, true); }  @Override void initialize(); @Override void index(Patient patient); @Override void delete(Patient patient); @Override void reindex(); }
SolrPatientIndexer implements PatientIndexer, Initializable { @Override public void index(Patient patient) { this.internalIndex(patient, true); }  @Override void initialize(); @Override void index(Patient patient); @Override void delete(Patient patient); @Override void reindex();  }