Skip to content

Commit

Permalink
Rename SolrIndexer to SolrIndexerStoreEventHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Warren committed Apr 3, 2020
1 parent 16d0d02 commit 0dff2b5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.content.commons.search.IndexService;
import org.springframework.content.solr.SolrIndexer;
import org.springframework.content.solr.SolrIndexerStoreEventHandler;
import org.springframework.content.solr.SolrProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
Expand Down Expand Up @@ -38,6 +38,6 @@ public IndexService solrIndexService() {

@Bean
public Object solrFulltextEventListener() {
return new SolrIndexer(solrIndexService());
return new SolrIndexerStoreEventHandler(solrIndexService());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.content.commons.search.IndexService;
import org.springframework.content.solr.SolrIndexer;
import org.springframework.content.solr.SolrIndexerStoreEventHandler;
import org.springframework.content.solr.SolrProperties;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -85,7 +85,7 @@ public IndexService solrIndexService() {

@Bean
public Object solrFulltextEventListener() {
return new SolrIndexer(solrIndexService());
return new SolrIndexerStoreEventHandler(solrIndexService());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FullTextSolrIndexingConfig {

@Bean
public Object solrFulltextEventListener() {
return new SolrIndexer(solrFulltextIndexService());
return new SolrIndexerStoreEventHandler(solrFulltextIndexService());
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import org.springframework.util.Assert;

@StoreEventHandler
public class SolrIndexer {
public class SolrIndexerStoreEventHandler {

private final IndexService indexer;

@Autowired
public SolrIndexer(IndexService indexer) {
public SolrIndexerStoreEventHandler(IndexService indexer) {
Assert.notNull(indexer, "indexer must not be null");

this.indexer = indexer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class EnableFullTextSolrIndexingTest {
assertThat(context.getBean(SolrProperties.class), is(not(nullValue())));
});
It("should have a Solr indexing store event handler bean", () -> {
assertThat(context.getBean(SolrIndexer.class), is(not(nullValue())));
assertThat(context.getBean(SolrIndexerStoreEventHandler.class), is(not(nullValue())));
});
It("should have a Searchable implementation bean", () -> {
assertThat(context.getBeansOfType(SearchableImpl.class), is(not(nullValue())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.github.paulcwarren.ginkgo4j.Ginkgo4jConfiguration;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jRunner;
import org.apache.solr.client.solrj.SolrClient;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -38,9 +37,9 @@
@SuppressWarnings("unchecked")
@RunWith(Ginkgo4jRunner.class)
@Ginkgo4jConfiguration(threads = 1)
public class SolrIndexerTest {
public class SolrIndexerStoreEventHandlerTest {

private SolrIndexer handler;
private SolrIndexerStoreEventHandler handler;

// mocks
private ContentStore<Object, Serializable> store;
Expand All @@ -55,12 +54,12 @@ public class SolrIndexerTest {
private Throwable e;

{
Describe("SolrUpdateEventHandler", () -> {
Describe("SolrIndexerStoreEventHandler", () -> {
BeforeEach(() -> {
store = mock(ContentStore.class);
content = mock(InputStream.class);
indexer = mock(IndexService.class);
handler = new SolrIndexer(indexer);
handler = new SolrIndexerStoreEventHandler(indexer);
});
Context("#onAfterSetContent", () -> {
JustBeforeEach(() -> {
Expand Down

0 comments on commit 0dff2b5

Please sign in to comment.