Running tests: Numeric converters not found

spring-boot-starter-data-neo4j v2.1.5.RELEASE

I'm having an issue that only occurs when running tests. It seems that none of the standard numeric value converters are available while running tests, resulting in errors like

No converter found capable of converting from type [java.lang.Long] to type [java.lang.Double]

For instance, I may have a Float value on a relationship property, but if Neo4j has this as a Long or Double, the conversion fails. This does not happen when executing normally; only while running tests.

Does this sound familiar to anyone? Thanks!

It’s a twisted rope to follow behind the Spring magic. I think it may be an autowiring issue. I see the default/main conversionService gets fully populated with converters. That appears like it should come in via Neo4jOgmEntityInstantiatorConfigurationBean, but if it doesn’t, one is synthesized:

ConversionService conversionService = conversionServiceObjectProvider
               .getIfUnique(() -> new MetaDataDrivenConversionService(metaData));

And it appears the synthesized one is used, which has an empty converters array. So that’s a better handle on What, still doesn’t explain the Why.

I put a breakpoint Neo4jOgmEntityInstantiatorConfigurationBean:38 to see this in action – which is called by an even more opaque NativeConstructorAccessorImpl and a stack tracing to BeanUtils.

When executing normally, this comes populated with 169 converters! What would be different when running tests?