Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-03-03 10:17:33 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d3edb844c91754743d97bd3450994e1aea7a0857
d3edb844
1 parent
03458420
Passage a une consultation Solr multi-core
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
src/main/java/org/legrog/configuration/SolrJConfiguration.java
src/main/java/org/legrog/entities/PublisherSearchRepositorySolrj.java
src/test/java/org/legrog/entities/PublisherSearchRepositorySolrjTest.java
src/main/java/org/legrog/configuration/SolrJConfiguration.java
View file @
d3edb84
...
...
@@ -17,7 +17,7 @@ public class SolrJConfiguration {
*/
@Produces
public
SolrClient
createSolrClient
()
{
return
new
HttpSolrClient
.
Builder
(
"http://localhost:8983/solr
/publishers
"
).
build
();
return
new
HttpSolrClient
.
Builder
(
"http://localhost:8983/solr"
).
build
();
}
}
...
...
src/main/java/org/legrog/entities/PublisherSearchRepositorySolrj.java
View file @
d3edb84
...
...
@@ -50,7 +50,7 @@ public class PublisherSearchRepositorySolrj implements PublisherSearchRepository
SolrQuery
solrQuery
=
new
SolrQuery
(
string
);
QueryResponse
queryResponse
;
try
{
queryResponse
=
solrClient
.
query
(
solrQuery
);
queryResponse
=
solrClient
.
query
(
"publishers"
,
solrQuery
);
}
catch
(
IOException
ioe
)
{
throw
new
SearchingException
(
ioe
);
}
catch
(
SolrServerException
sse
)
{
...
...
src/test/java/org/legrog/entities/PublisherSearchRepositorySolrjTest.java
View file @
d3edb84
...
...
@@ -84,7 +84,7 @@ public class PublisherSearchRepositorySolrjTest {
@DisplayName
(
"when repository in IO error, should throw a SearchingException"
)
@Test
public
void
searchIOETest
()
throws
IOException
,
SolrServerException
{
when
(
solrClient
.
query
(
Mockito
.
any
())).
thenThrow
(
new
IOException
());
when
(
solrClient
.
query
(
Mockito
.
any
String
(),
Mockito
.
any
())).
thenThrow
(
new
IOException
());
Assertions
.
assertThrows
(
SearchingException
.
class
,
()
->
publisherSearchRepository
.
search
(
"a"
));
}
...
...
@@ -105,7 +105,7 @@ public class PublisherSearchRepositorySolrjTest {
public
void
searchParameterTest
()
throws
IOException
,
SolrServerException
{
try
{
publisherSearchRepository
.
search
(
"c"
);
Mockito
.
verify
(
solrClient
).
query
(
solrParamsArgumentCaptor
.
capture
());
Mockito
.
verify
(
solrClient
).
query
(
Mockito
.
anyString
(),
solrParamsArgumentCaptor
.
capture
());
}
catch
(
SearchingException
se
)
{
logger
.
error
(
"SearchingException {}"
,
se
);
}
...
...
Please
register
or
login
to post a comment