SpringBoot Junit 測試
如果當你 Junit 測試的時候報這個錯,就要看過來了
java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy
Caused by: java.lang.ClassNotFoundException: org.springframework.core.annotation.MergedAnnotations$SearchStrategy
解決辦法:檢查Spring-test的版本是否跟parent依賴版本保持一致
一般情況都是因爲這個原因,版本不一致,導致不兼容。