@Test public void indexDefaultGeneBehaviourTest() 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(); 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(Collections.EMPTY_SET).when(this.patient).getFeatures(); List<Gene> fakeGenes = new LinkedList<>(); fakeGenes.add(mockGene("CANDIDATE1", "candidate")); fakeGenes.add(mockGene("REJECTED1", "rejected")); fakeGenes.add(mockGene("REJECTEDC1", "rejected_candidate")); fakeGenes.add(mockGene("CARRIER1", "carrier")); fakeGenes.add(mockGene("SOLVED1", "solved")); PatientData<Gene> fakeGeneData = new IndexedPatientData<>("genes", fakeGenes); doReturn(fakeGeneData).when(this.patient).getData("genes"); 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); Collection<Object> indexedGenes; indexedGenes = inputDoc.getFieldValues("candidate_genes"); Assert.assertEquals(1, indexedGenes.size()); Assert.assertEquals("CANDIDATE1", indexedGenes.iterator().next()); indexedGenes = inputDoc.getFieldValues("solved_genes"); Assert.assertEquals(1, indexedGenes.size()); Assert.assertEquals("SOLVED1", indexedGenes.iterator().next()); indexedGenes = inputDoc.getFieldValues("rejected_genes"); Assert.assertEquals(1, indexedGenes.size()); Assert.assertEquals("REJECTED1", indexedGenes.iterator().next()); indexedGenes = inputDoc.getFieldValues("rejected_candidate_genes"); Assert.assertEquals(1, indexedGenes.size()); Assert.assertEquals("REJECTEDC1", indexedGenes.iterator().next()); indexedGenes = inputDoc.getFieldValues("carrier_genes"); Assert.assertEquals(1, indexedGenes.size()); Assert.assertEquals("CARRIER1", indexedGenes.iterator().next()); }
@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();  }