use of org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext in project spring-boot by spring-projects.
the class ElasticsearchDataAutoConfigurationTests method defaultConversionsRegisterBigDecimalAsSimpleType.
@Test
void defaultConversionsRegisterBigDecimalAsSimpleType() {
this.contextRunner.run((context) -> {
SimpleElasticsearchMappingContext mappingContext = context.getBean(SimpleElasticsearchMappingContext.class);
assertThat(mappingContext).extracting("simpleTypeHolder", InstanceOfAssertFactories.type(SimpleTypeHolder.class)).satisfies((simpleTypeHolder) -> assertThat(simpleTypeHolder.isSimpleType(BigDecimal.class)).isTrue());
});
}
use of org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext in project spring-data-elasticsearch by spring-projects.
the class AbstractElasticsearchTemplate method createElasticsearchConverter.
private ElasticsearchConverter createElasticsearchConverter() {
MappingElasticsearchConverter mappingElasticsearchConverter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
mappingElasticsearchConverter.afterPropertiesSet();
return mappingElasticsearchConverter;
}
use of org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext in project spring-data-elasticsearch by spring-projects.
the class ElasticsearchPartQueryTests method setUp.
@BeforeEach
public void setUp() {
converter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
when(operations.getElasticsearchConverter()).thenReturn(converter);
}
use of org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext in project spring-data-elasticsearch by spring-projects.
the class CriteriaQueryMappingUnitTests method setUp.
// region setup
@BeforeEach
void setUp() {
SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext();
mappingContext.setInitialEntitySet(Collections.singleton(Person.class));
mappingContext.afterPropertiesSet();
mappingElasticsearchConverter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
mappingElasticsearchConverter.afterPropertiesSet();
}
use of org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext in project spring-data-elasticsearch by spring-projects.
the class ElasticsearchStringQueryUnitTestBase method setupConverter.
protected ElasticsearchConverter setupConverter() {
MappingElasticsearchConverter converter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
Collection<Converter<?, ?>> converters = new ArrayList<>();
converters.add(ElasticsearchStringQueryUnitTests.CarConverter.INSTANCE);
CustomConversions customConversions = new ElasticsearchCustomConversions(converters);
converter.setConversions(customConversions);
converter.afterPropertiesSet();
return converter;
}
Aggregations