Skip to content

Commit 935b815

Browse files
nboseckerKevinGilmore
authored andcommitted
Updated test names and moved document add code to @before method. (eugenp#1187)
* Solr w Apache SolrJ * Solr w Apache SolrJ * updated test names and moved add to @before method
1 parent 6b0e59a commit 935b815

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎spring-data-solr/src/test/java/com/baeldung/solrjava/SolrJavaIntegrationTest.java‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
public class SolrJavaIntegrationTest {
1919

2020
private HttpSolrClient solr;
21+
private SolrInputDocument document;
2122

2223
@Before
2324
public void setUp() throws Exception {
2425

2526
solr = new HttpSolrClient("http://localhost:8983/solr/bigboxstore");
2627
solr.setParser(new XMLResponseParser());
27-
}
28-
29-
@Test
30-
public void givenAdd_thenVerifyAdded() throws SolrServerException, IOException {
31-
32-
SolrInputDocument document = new SolrInputDocument();
28+
29+
document = new SolrInputDocument();
3330
document.addField("id", "123456");
3431
document.addField("name", "Kenmore Dishwasher");
3532
document.addField("price", "599.99");
36-
3733
solr.add(document);
3834
solr.commit();
35+
}
36+
37+
@Test
38+
public void whenAdd_thenVerifyAdded() throws SolrServerException, IOException {
3939

4040
SolrQuery query = new SolrQuery();
4141
query.set("q", "id:123456");
@@ -53,7 +53,7 @@ public void givenAdd_thenVerifyAdded() throws SolrServerException, IOException {
5353
}
5454

5555
@Test
56-
public void givenDelete_thenVerifyDeleted() throws SolrServerException, IOException {
56+
public void whenDelete_thenVerifyDeleted() throws SolrServerException, IOException {
5757

5858
solr.deleteById("123456");
5959
solr.commit();

0 commit comments

Comments
 (0)