我有一个使用Spring和Junit 5的简单应用程序:
当使用Spring 2.1 (例如,2.1.8或2.1.12)时,我的单元测试运行平稳
当使用SpringBoot2.2(例如,2.2.2.RELEASE或2.3.2.RELEASE)时,我的单元测试失败并出现错误消息
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project XXX: There are test failures.
[ERROR]
我已经创建了一个springboot项目,分为三个maven模块,域层、核心层(包含持久性和业务逻辑)和web层。我尝试单元测试我的存储库ProductRepository (位于核心层)。
@RunWith(SpringRunner.class) // provide bridge between SpringBoot test features and JUnit, for usage of springboot tsting features
@DataJpaTest
class ProductRepositoryTest {
@Autowired
private TestEnt
我正在尝试测试存储库。遗憾的是,当我尝试测试时,我总是得到相同的错误。错误如下:
java.lang.NullPointerException
at com.changing.springboot.repository.TemplateRepositoryTest.should_return_templateName_when_call_findByTemplateName(TemplateRepositoryTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at s
我正在尝试启动一个驻留在中的springboot应用程序。我克隆了回购程序,并在启动下面看到的应用程序时清除了install.Later。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kieServer' defined in class path resource [org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.class]: Bean instant
可以帮助我解决这个错误并解释我出了什么问题?
我正在开发一个简单的骆驼路线来处理一个信息,然后将它存储在一个文件中。
我正在使用的技术:
3.3.0Spring-boot JDK 11Apache Camel 2.3.0
当我想测试骆驼路线时,我得到了以下错误。
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[]
at org.apache.camel.CamelExecutionException.wrapCamelEx