Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
使用注释@Sql,是否可以在方法级别之前执行类级别的脚本?
我想在每个测试方法之前执行两个脚本 但我也想定义一些脚本在特定方法之前执行 使用 Spring 框架和 Sql注释 可以吗 RunWith SpringJUnit4ClassRunner class ContextConfiguration
Spring
springtest
Spring JUnit 测试未加载完整的应用程序上下文
您好 我正在尝试使用 spring junit 测试用例 并且我需要加载完整的应用程序上下文 然而 junit 测试不会初始化完整的应用程序上下文 测试类 RunWith SpringJUnit4ClassRunner class Spri
Java
Spring
JUnit
springboot
springtest
如何使用 spring-test-junit5 进行嵌套测试?
我一直在玩JUnit 5 http junit org junit5 and 弹簧测试junit5 https github com sbrannen spring test junit5 然后我尝试使用嵌套测试 http junit or
springtest
Junit5
在所有 SpringBootTest 中使用一个 Spring Boot 上下文
我希望能够通过使用 junit 进行测试的不同类来缓存应用程序上下文 测试类是这样声明的 SpringBootTest RunWith SpringRunner class public class SomeIntegrationTest
Java
Spring
springboot
JUnit
springtest
在单元测试中使用SpringRunner可以吗?
我们正在与我的同事争论这种方法 他们说仅在集成或功能级别上使用 SpringRunner 问题是在下面的级别中使用它有什么优点和缺点 例如我有简单的豆 public class RewardDurationCalculator privat
Java
Spring
unittesting
springtest
SpringRunner
在 Spring 中配置特定的内存数据库用于测试目的
我该如何配置我的春季启动应用程序 以便当我运行时单元测试它将使用在记忆中数据库如H2 HSQL但当我跑步时春季启动应用程序它将使用生产数据库PostgreSQL MySQL 为此可以使用弹簧型材 这将是一种具体的方式 具有特定于环境的属性文
Spring
springboot
springdata
springtest
springtestdbunit
使用@Async方法的JUnit回滚事务
我正在使用编写集成测试SpringJUnit4ClassRunner 我有一个基类 RunWith SpringJUnit4ClassRunner class WebAppConfiguration ContextConfiguration
Java
JUnit
springtransactions
springtest
springasync
将超类中的 @Sql 与子类中的 @Sql 合并
我有一个带有注释的抽象类 Sql executionPhase ExecutionPhase BEFORE TEST METHOD scripts someScript 我有一个继承自抽象类的测试类 子类也注释为 Sql execution
Java
Spring
Testing
springboot
springtest
Spring MockMvcBuilders 安全过滤器
我已经设法使用 spring mvc 创建 REST API 我的目的是用 JWToken 保护资源 现在我正在尝试编写三个测试 1 使用授予的用户 密码获取 Token 身份验证失败 gt test OK2 获取未授予用户 密码的Toke
Spring
SpringMVC
SpringSecurity
springtest
防止@EnableWebMvc注释的类被@ComponentScan拾取
我有以下测试类 ActiveProfiles DataTC test RunWith SpringJUnit4ClassRunner class ContextConfiguration classes BaseTestConfigurat
Spring
springtest
Spring Boot 单元测试中的@SpringBootTest、@ContextConfiguration、@Import
我正在开发一个 Spring Boot 项目 我正在写一个Unit Test代码基于TDD这有点困难 SpringBootTest加载所有 bean 这导致测试时间更长 所以我用了 SpringBootTest的班级名称 我正常完成了测试
Spring
springboot
unittesting
integrationtesting
springtest
Spring集成测试时如何mock Eureka?
我正在 Spring Boot 中运行一个简单的 Junit 测试控制器 测试代码如下所示 RunWith SpringJUnit4ClassRunner class SpringApplicationConfiguration class
Spring
springtest
springtestmvc
netflixeureka
我在 Spring 安全测试中遇到 stackOverflowError
安全配置类 Configuration EnableGlobalMethodSecurity prePostEnabled true public class SecurityConf Bean public AuthenticationM
Java
springboot
Maven
SpringSecurity
springtest
一起测试 Spring asyncResult() 和 jsonPath()
我使用 Restful url 来启动长时间运行的后端进程 它通常按照 cron 计划进行 但我们希望能够手动启动它 下面的代码有效 当我手动测试时 我在浏览器中看到结果 ResponseBody RequestMapping value
json
SpringMVC
springtest
springtestmvc
spring 上下文中的测试套件
是否可以使用加载的 spring 上下文运行测试套件 如下所示 RunWith Suite class SuiteClasses Test1 class Test2 class ContextConfiguration locations
Spring
JUnit
springtest
testsuite
在 Spring Boot 中使用 @TestPropertySource 覆盖 @PropertySource
我有我的 Spring Boot 主类 SpringBootApplication PropertySource file my file properties public class Application extends Spring
Java
Spring
springboot
springtest
使用 TestExecutionListener 时 Spring 测试注入不起作用
我想使用自定义TestExecutionListener结合SpringJUnit4ClassRunner在我的测试数据库上运行 Liquibase 架构设置 我的TestExecutionListener工作正常 但是当我在类上使用注释时
Java
Spring
Liquibase
springtest
无法使用 Spring 进行 JUnit 测试
我的测试定义如下 package com mytest RunWith SpringJUnit4ClassRunner class ContextConfiguration public class SpringTestCase Test
Java
Spring
Junit4
springtest
NoSuchBeanDefinitionException:未找到与 spring 测试和 Junit 相关的合格 bean 类型
我正在使用 spring 测试和 Junit 编写测试用例 并在初始化 bean 时遇到错误 我发现了很多关于此的帖子 但对我来说没有任何作用 下面是我的代码 Pom xml
Spring
JUnit
springtest
Spring异步方法集成测试失败
我为异步休息控制器方法创建了一个集成测试 看起来像 Test public void shouldHandleRequestsAsynchronously throws Exception MvcResult mvcResult this
springboot
springtest
springrestcontroller
springrest
1
2
3
4
»