@Test public void indexDefaultPhenotypeBehaviourTest() throws IOException, SolrServerException { Set<Feature> patientFeatures = new HashSet<>(); Feature testFeature = mock(Feature.class); doReturn(true).when(testFeature).isPresent(); doReturn("phenotype").when(testFeature).getType(); doReturn("HP:0001367").when(testFeature).getId(); patientFeatures.add(testFeature); Feature negativeTestFeature = mock(Feature.class); doReturn(false).when(negativeTestFeature).isPresent(); doReturn("phenotype").when(negativeTestFeature).getType(); doReturn("id2").when(negativeTestFeature).getId(); patientFeatures.add(negativeTestFeature); doReturn(patientFeatures).when(this.patient).getFeatures(); DocumentReference reporterReference = new DocumentReference("xwiki", "XWiki", "user"); EntityAccess entityAccess = mock(DefaultEntityAccess.class); Visibility patientVisibility = new PublicVisibility(); CapturingMatcher<SolrInputDocument> capturedArgument = new CapturingMatcher<>(); when(this.server.add(argThat(capturedArgument))).thenReturn(mock(UpdateResponse.class)); doReturn(this.patientDocReference).when(this.patient).getDocumentReference(); doReturn(reporterReference).when(this.patient).getReporter(); doReturn(entityAccess).when(this.permissions).getEntityAccess(this.patient); doReturn(patientVisibility).when(entityAccess).getVisibility(); this.patientIndexer.index(this.patient); SolrInputDocument inputDoc = capturedArgument.getLastValue(); verify(this.server).add(inputDoc); Assert.assertEquals("public", inputDoc.getFieldValue("visibility")); Assert.assertEquals("HP:0001367", inputDoc.getFieldValue("phenotype")); Assert.assertEquals("id2", inputDoc.getFieldValue("negative_phenotype")); Assert.assertEquals(5, inputDoc.getFieldValues("extended_phenotype").size()); }
@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();  }