Skip to content

Commit 2843c8c

Browse files
committed
HSEARCH-3825 Test SearchIndexingPlan.purge with a custom routing key mapping
1 parent 22fd8b9 commit 2843c8c

File tree

1 file changed

+16
-0
lines changed
  • integrationtest/mapper/pojo-base/src/test/java/org/hibernate/search/integrationtest/mapper/pojo/routing

1 file changed

+16
-0
lines changed

integrationtest/mapper/pojo-base/src/test/java/org/hibernate/search/integrationtest/mapper/pojo/routing/RoutingBaseIT.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.hibernate.search.util.impl.integrationtest.common.rule.BackendMock;
2828
import org.hibernate.search.util.impl.integrationtest.common.rule.StubSearchWorkBehavior;
2929
import org.hibernate.search.util.impl.integrationtest.common.stub.backend.document.StubDocumentNode;
30+
import org.hibernate.search.util.impl.test.annotation.TestForIssue;
3031

3132
import org.junit.Before;
3233
import org.junit.Rule;
@@ -104,6 +105,21 @@ public void index_multiTenancy() {
104105
}
105106
}
106107

108+
@Test
109+
@TestForIssue(jiraKey = "HSEARCH-3825")
110+
public void purge() {
111+
try ( SearchSession session = mapping.createSession() ) {
112+
session.indexingPlan().purge( IndexedEntity.class, 42, "category_2" );
113+
114+
backendMock.expectWorks( IndexedEntity.INDEX )
115+
.delete( b -> b
116+
.identifier( "42" )
117+
.routingKey( "category_2" )
118+
)
119+
.processedThenExecuted();
120+
}
121+
}
122+
107123
@Test
108124
public void search() {
109125
try ( SearchSession session = mapping.createSession() ) {

0 commit comments

Comments
 (0)