I'm working on Spring Webflux, Kotlin, Mongo Project.
I'm using EmbeddedMongoDB to back DB in test codes.
Because spring tests automatically use EmbeddedMongoDB when not configured, we had to always exclude it like this post suggests.
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration
For test cases that needs EmbeddedMongoDB, I made a custom annotation class just like this post's answer.
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS)
@Import(EmbeddedMongoAutoConfiguration::class)
annotation class EnableEmbeddedMongo
But when I ran tests that don't need EmbeddedMongoDB on Apple Silicon M1 macbooks, the default exclusion doesn't work, and embeddedMongoDB would just start even when I didn't attached EnableEmbeddedMongo
annotation.
What could be the problem?