Extending a Java Test Framework with SPI
summary
Concrete claim: Java's decades‑old Service Provider Interface (SPI) is the core of a plugin architecture that turns a monolithic end‑to‑end test framework into modular components. The team implements tiny plugin interfaces, maps implementations via META-INF/services and ServiceLoader, and manages plugin lifecycle and properties. Results: many 10–20‑line plugins for grids, Kafka logging, Slack and reports, internal vs external plugins, fast POCs and easier maintenance. The framework runs in production at Tvago for nine years and the approach demonstrably reduces coupling and speeds integration.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:34Java and framework challenges
- 3:20Test framework evolution
- 7:38SPI as solution
- 9:03SPI fundamentals
- 13:29Interface segregation
- 14:11Plug-in examples
- 15:37Plug-in discovery
- 17:49ServiceLoader loading
- 20:19Runtime plug-in invocation
- 23:49Plug-in lifecycle
- 26:13Internal vs external plug-ins
- 27:17Property management
- 28:43Tvago use cases
- 30:31SPI benefits and trade-offs
- 32:20Demo and GitHub walkthrough
- 32:43Happy 30th birthday to Java
- 33:05Q&A
related talks
51mSpock Framework: The Ultimate Framework for Testing Your Java Applications
02h 36mTesting Java Microservice
47mMicroservices Testing with Java
56mBuilding a Framework on top of Spring Boot
32mAccelerating Collaborative Plugin Development
41mSoftware Architecture — Yes, on Tests
45mOf plugins & decorators-spotlight on Trivago's e2e test framework
45mWhy Use Spock Instead of JUnit Mockito for Your Java Tests
