Jean-Francois Leveque

Passage a une consultation Solr multi-core

...@@ -17,7 +17,7 @@ public class SolrJConfiguration { ...@@ -17,7 +17,7 @@ public class SolrJConfiguration {
17 */ 17 */
18 @Produces 18 @Produces
19 public SolrClient createSolrClient() { 19 public SolrClient createSolrClient() {
20 - return new HttpSolrClient.Builder("http://localhost:8983/solr/publishers").build(); 20 + return new HttpSolrClient.Builder("http://localhost:8983/solr").build();
21 } 21 }
22 22
23 } 23 }
......
...@@ -50,7 +50,7 @@ public class PublisherSearchRepositorySolrj implements PublisherSearchRepository ...@@ -50,7 +50,7 @@ public class PublisherSearchRepositorySolrj implements PublisherSearchRepository
50 SolrQuery solrQuery = new SolrQuery(string); 50 SolrQuery solrQuery = new SolrQuery(string);
51 QueryResponse queryResponse; 51 QueryResponse queryResponse;
52 try { 52 try {
53 - queryResponse = solrClient.query(solrQuery); 53 + queryResponse = solrClient.query("publishers", solrQuery);
54 } catch (IOException ioe) { 54 } catch (IOException ioe) {
55 throw new SearchingException(ioe); 55 throw new SearchingException(ioe);
56 } catch (SolrServerException sse) { 56 } catch (SolrServerException sse) {
......
...@@ -84,7 +84,7 @@ public class PublisherSearchRepositorySolrjTest { ...@@ -84,7 +84,7 @@ public class PublisherSearchRepositorySolrjTest {
84 @DisplayName("when repository in IO error, should throw a SearchingException") 84 @DisplayName("when repository in IO error, should throw a SearchingException")
85 @Test 85 @Test
86 public void searchIOETest() throws IOException, SolrServerException{ 86 public void searchIOETest() throws IOException, SolrServerException{
87 - when(solrClient.query(Mockito.any())).thenThrow(new IOException()); 87 + when(solrClient.query(Mockito.anyString(), Mockito.any())).thenThrow(new IOException());
88 Assertions.assertThrows(SearchingException.class, () -> publisherSearchRepository.search("a")); 88 Assertions.assertThrows(SearchingException.class, () -> publisherSearchRepository.search("a"));
89 } 89 }
90 90
...@@ -105,7 +105,7 @@ public class PublisherSearchRepositorySolrjTest { ...@@ -105,7 +105,7 @@ public class PublisherSearchRepositorySolrjTest {
105 public void searchParameterTest() throws IOException, SolrServerException { 105 public void searchParameterTest() throws IOException, SolrServerException {
106 try { 106 try {
107 publisherSearchRepository.search("c"); 107 publisherSearchRepository.search("c");
108 - Mockito.verify(solrClient).query(solrParamsArgumentCaptor.capture()); 108 + Mockito.verify(solrClient).query(Mockito.anyString(), solrParamsArgumentCaptor.capture());
109 } catch (SearchingException se) { 109 } catch (SearchingException se) {
110 logger.error("SearchingException {}", se); 110 logger.error("SearchingException {}", se);
111 } 111 }
......