use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.InvalidType in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method invalidType_noDslConverter.
@Test
public void invalidType_noDslConverter() {
StubMappingScope scope = mainIndex.createScope();
String absoluteFieldPath = getFieldPath();
Object invalidValueToMatch = new InvalidType();
assertThatThrownBy(() -> scope.sort().field(absoluteFieldPath).missing().use(invalidValueToMatch), "field() sort with invalid parameter type for missing().use() on field " + absoluteFieldPath).isInstanceOf(SearchException.class).hasMessageContaining("Unable to convert DSL argument: ").hasMessageContaining(InvalidType.class.getName()).hasCauseInstanceOf(ClassCastException.class).satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexFieldAbsolutePath(absoluteFieldPath)));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.InvalidType in project hibernate-search by hibernate.
the class FieldSortTypeCheckingAndConversionIT method invalidType_withDslConverter.
@Test
public void invalidType_withDslConverter() {
StubMappingScope scope = mainIndex.createScope();
String absoluteFieldPath = getFieldWithDslConverterPath();
Object invalidValueToMatch = new InvalidType();
assertThatThrownBy(() -> scope.sort().field(absoluteFieldPath).missing().use(invalidValueToMatch), "field() sort with invalid parameter type for missing().use() on field " + absoluteFieldPath).isInstanceOf(SearchException.class).hasMessageContaining("Unable to convert DSL argument: ").hasMessageContaining(InvalidType.class.getName()).hasCauseInstanceOf(ClassCastException.class).satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexFieldAbsolutePath(absoluteFieldPath)));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.InvalidType in project hibernate-search by hibernate.
the class FieldSearchSortTypeCheckingAndConversionIT method invalidType_withDslConverter.
@Test
public void invalidType_withDslConverter() {
StubMappingScope scope = mainIndex.createScope();
String absoluteFieldPath = getFieldWithDslConverterPath();
Object invalidValueToMatch = new InvalidType();
assertThatThrownBy(() -> scope.sort().field(absoluteFieldPath).missing().use(invalidValueToMatch), "field() sort with invalid parameter type for missing().use() on field " + absoluteFieldPath).isInstanceOf(SearchException.class).hasMessageContaining("Unable to convert DSL argument: ").hasMessageContaining(InvalidType.class.getName()).hasCauseInstanceOf(ClassCastException.class).satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexFieldAbsolutePath(absoluteFieldPath)));
}
use of org.hibernate.search.integrationtest.backend.tck.testsupport.util.InvalidType in project hibernate-search by hibernate.
the class FieldSortTypeCheckingAndConversionIT method invalidType_noDslConverter.
@Test
public void invalidType_noDslConverter() {
StubMappingScope scope = mainIndex.createScope();
String absoluteFieldPath = getFieldPath();
Object invalidValueToMatch = new InvalidType();
assertThatThrownBy(() -> scope.sort().field(absoluteFieldPath).missing().use(invalidValueToMatch), "field() sort with invalid parameter type for missing().use() on field " + absoluteFieldPath).isInstanceOf(SearchException.class).hasMessageContaining("Unable to convert DSL argument: ").hasMessageContaining(InvalidType.class.getName()).hasCauseInstanceOf(ClassCastException.class).satisfies(FailureReportUtils.hasContext(EventContexts.fromIndexFieldAbsolutePath(absoluteFieldPath)));
}
Aggregations