Spring TestContext Framework Configuration

Reading time ~1 minute

This note is about the configuration of testing environment with Spring.

Dependency with Maven

<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-test</artifactId>
	<version>{$version}</version>
</dependency>

Annotations above class

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
        "classpath*:*.xml"
})
@Transactional

Rollback

The test rolls back transaction for test context after testing. So do not worry when see nothing happens in database.

竟然无法拒绝你的打赏

微信支付

专业处理中国护照照片一次通过

专业处理中国护照照片一次通过 Continue reading

Python Notes

Published on April 01, 2021

Scrum Training Notes

Published on December 01, 2020