When the unit test is run and the hotswap agent plugin is used, the initializePlugin reports a NullPointerException error when the application is started

Caused by: java.lang.NullPointerException
    at org.hotswap.agent.config.PluginRegistry.initializePlugin(PluginRegistry.java:179)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:193)
    at org.springframework.context.support.GenericApplicationContext.<init>(GenericApplicationContext.java:113)
    at org.springframework.web.context.support.GenericWebApplicationContext.<init>(GenericWebApplicationContext.java:97)
    at org.springframework.boot.test.context.SpringBootContextLoader$WebConfigurer.lambda$configure$0(SpringBootContextLoader.java:288)
    at org.springframework.boot.SpringApplication.createApplicationContext(SpringApplication.java:610)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:336)

env: junit4, spring boot 2.5.12, hotswap agent 1.4.1

0

There are 0 best solutions below