Testing with Spring 4.x
summary
Practical walkthrough of Spring Framework 4.0–4.1 testing: shows SocketUtils for finding free TCP/UDP ports, the new TestContext bootstrap and listener merging, programmatic TestTransaction API to end/start test transactions and flagForCommit()/flagForRollback(), declarative @Sql with execution phases and repeatable configs, Groovy-based ApplicationContext loading, MockMvc/JSON assertion upgrades, and embedded DB/script utils with multi‑line comment support — includes code snippets and XML/Java/Groovy examples.
AI-written summary · about
chapters (37)
- 0:00Intro
- 0:29Sam Brannen
- 2:52Agenda
- 3:36Spring Cleaning in 4.x
- 4:13Pruning in 4.0
- 5:38Dependency Upgrades in 4.0
- 7:03Testing Themes from Spring 3.x (2/2)
- 10:18Ex: Web Integration Test (1/2)
- 16:06New in 4.0 (2/3)
- 20:39New in 4.1 - Context Config
- 21:15New in 4.1 -Transactions and SQL
- 21:59New in 4.1 - Bootstrap & TestExecutionListeners
- 26:16New in 4.1 - Spring MVC Test
- 27:23New in 4.1 - Odds & Ends
- 29:38Using SocketUtils in XML Config
- 32:00Tip: Define Free Port as Bean
- 34:02Ex: @Active Profiles - Programmatic
- 34:42Composable Stereotypes - Quick Review
- 36:17Duplicate Test Configuration == Bad
- 36:43Custom Test Annotation == Good
- 37:13Composable Annotations with Overrides
- 38:57Optional Annotation Attribute Override
- 40:21Required Annotation Attribute Override
- 41:13Groovy Beans in Spring
- 43:32Groovy Scripts for Context Config in Tests
- 45:29Ex: Groovy Script Config
- 46:17Ex: Default Groovy Script Detection
- 47:04Ex: Groovy & XML Config Together
- 47:45Test Property Sources
- 49:16@TestProperty Source - locations
- 51:25@TestProperty Source - properties
- 52:14Ex: @Test Property Source - properties
- 53:21Default Properties File Detection
- 54:21@TestProperty Source - Precedence
- 55:31Ex: @Test Property Source - locations & properties
- 56:12Programmatic Transaction Management in Tests
- 57:18Transactions in Spring
related talks
01h 27mGet the Most out of Testing with Spring 4.2
41mIntegration Testing with Spring
53mTesting Spring Boot Applications Demystified
44mTesting Web Apps with Spring Framework
50mTesting Spring Boot Applications
50mTesting with Spring and JUnit 5
56mLearning Spring Boot with TDD
02h 43mSpring Boot testing: Zero to Hero
