Created
January 21, 2016 20:37
-
-
Save daveshah/c908d8336e7b2f99209c to your computer and use it in GitHub Desktop.
(non-working) attempt at DIH into Solr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def "Loading into the solr core"() { | |
given: "An empty solr core" | |
def solrServer = new EmbeddedSolrServer(Paths.get("../solr"), "corename") | |
when: "I load the core" | |
def params = new ModifiableSolrParams(){{ | |
add("command","full-import") | |
add("clean","true") | |
add("commit","true") | |
}} | |
solrServer.request(new GenericSolrRequest(SolrRequest.METHOD.POST,"/dataimport",params)) | |
then: "I should recieve documents from Solr" | |
def responseWithResults = solrServer.query(new ModifiableSolrParams() { | |
{ | |
add("q", "*:*") | |
} | |
}) | |
def expectedNumberOfResults = 10 | |
def numberOfResultsFromTheSolrQuery = responseWithResults.results.size() | |
expectedNumberOfResults == numberOfResultsFromTheSolrQuery | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment