老项目使用
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.5</version>
</dependency>
替换为
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.4.1</version>
</dependency>
已经可以正常使用代码生成器,但是运行之前的单元测试,发现出现异常,
15:15:43.064 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class cn.com.git.batch.service.CheckConfigServiceTest]
15:15:43.076 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
15:15:43.109 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
15:15:43.283 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [cn.com.git.batch.service.CheckConfigServiceTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
15:15:43.359 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [cn.com.git.batch.service.CheckConfigServiceTest], using SpringBootContextLoader
15:15:43.378 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [cn.com.git.batch.service.CheckConfigServiceTest]: class path resource [cn/com/git/batch/service/CheckConfigServiceTest-context.xml] does not exist
15:15:43.380 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [cn.com.git.batch.service.CheckConfigServiceTest]: class path resource [cn/com/git/batch/service/CheckConfigServiceTestContext.groovy] does not exist
15:15:43.381 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [cn.com.git.batch.service.CheckConfigServiceTest]: no resource found for suffixes {-context.xml, Context.groovy}.
15:15:43.384 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [cn.com.git.batch.service.CheckConfigServiceTest]: CheckConfigServiceTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
15:15:43.571 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [cn.com.git.batch.service.CheckConfigServiceTest]
15:15:44.135 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\git\git\batch-springboot\batch-springboot\batch-view\target\classes\cn\com\git\WebApplication.class]
15:15:44.142 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration cn.com.git.WebApplication for test class cn.com.git.batch.service.CheckConfigServiceTest
15:15:44.714 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [cn.com.git.batch.service.CheckConfigServiceTest]: using defaults.
15:15:44.717 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
15:15:44.793 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@59af0466, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3e6ef8ad, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@346d61be, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@55536d9e, org.springframework.test.context.support.DirtiesContextTestExecutionListener@747edf66, org.springframework.test.context.transaction.TransactionalTestExecutionListener@3d1cfad4, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@62230c58, org.springframework.test.context.event.EventPublishingTestExecutionListener@2cd2a21f, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@2e55dd0c, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@74455848, org.sprin