Skip to content

Commit

Permalink
HSEARCH-4331 Make DocumentIdDefaultBridgeBaseIT#indexing work even wh…
Browse files Browse the repository at this point in the history
…en there are multiple values that are equal

This can happen with JavaUtilDatePropertyTypeDescriptor in particular:
we test different dates representing the same instant (thus equal
according to equals()) but with a different type (java.util.Date and
java.sql.Date).
  • Loading branch information
yrodiere authored and fax4ever committed Oct 6, 2021
1 parent 7343b19 commit 2783219
Showing 1 changed file with 5 additions and 8 deletions.
Expand Up @@ -94,17 +94,14 @@ public void setup() {

@Test
public void indexing() {
try ( SearchSession session = mapping.createSession() ) {
for ( I entityIdentifierValue : typeDescriptor.values().entityModelValues ) {
Iterator<String> documentIdentifierIterator = typeDescriptor.values().documentIdentifierValues.iterator();
for ( I entityIdentifierValue : typeDescriptor.values().entityModelValues ) {
try ( SearchSession session = mapping.createSession() ) {
Object entity = expectations.instantiateTypeWithIdentifierBridge1( entityIdentifierValue );
session.indexingPlan().add( entity );
}

BackendMock.DocumentWorkCallListContext expectationSetter = backendMock.expectWorks(
DefaultIdentifierBridgeExpectations.TYPE_WITH_IDENTIFIER_BRIDGE_1_NAME
);
for ( String expectedDocumentIdentifierValue : typeDescriptor.values().documentIdentifierValues ) {
expectationSetter.add( expectedDocumentIdentifierValue, b -> { } );
backendMock.expectWorks( DefaultIdentifierBridgeExpectations.TYPE_WITH_IDENTIFIER_BRIDGE_1_NAME )
.add( documentIdentifierIterator.next(), b -> { } );
}
}
backendMock.verifyExpectationsMet();
Expand Down

0 comments on commit 2783219

Please sign in to comment.