What Is New in Spring Boot 1.4
Spring Boot 1.4 delivers a significant upgrade with new starters, testing enhancements, and developer tooling improvements. This release builds on the core principles of rapid application development while introducing modern best practices.
| Category | Key Changes |
|---|---|
| New Features | Hibernate 5.2, Apache Geode/Apache Tomcat 8.5, Jersey support, Couchbase auto-configuration |
| Testing | @JsonTest, @MockBean, @SpyBean, JSON assertions, TestRestTemplate improvements |
| Developer Tools | LiveReload for Thymeleaf, restart enhancements, new properties |
| Improvements | Spring Framework 4.3, Gradle plugin, Maven plugin, embedded servlet container updates |
| Deprecations | CRaSH support, spring-boot-legacy, certain auto-configuration classes |
What testing enhancements were introduced?
Spring Boot 1.4 dramatically simplifies unit and integration testing with several new annotations and utilities. The new @JsonTest annotation focuses your tests specifically on JSON serialization and deserialization.
You can now easily mock and spy on beans within your application context using @MockBean and @SpyBean. This is a game-changer for testing components that rely on Spring's dependency injection.
Example: Using @MockBean
@RunWith(SpringRunner.class)
@SpringBootTest
public class MyTest {
@MockBean
private SomeService someService;
@Test
public void testMethod() {
given(this.someService.doSomething()).willReturn("test");
// ... rest of the test
}
}
How did developer tooling get better?
Developer experience received a major boost with LiveReload now supporting Thymeleaf template updates without a full application restart. This makes the code-save-view feedback loop incredibly fast for UI development.
The restart mechanism is now smarter and more configurable. You can exclude specific paths from triggering a restart, which is useful for temporary files or logs. New properties like spring.devtools.restart.exclude give you fine-grained control.
What new starters and integrations are available?
This release adds first-class support for several new technologies. The new spring-boot-starter-json starter provides a coherent way to pull in Jackson and JSR-353 dependencies for modern JSON handling.
Apache Geode auto-configuration and a dedicated starter (spring-boot-starter-data-geode) are now included. You also get full auto-configuration support for Apache Tomcat 8.5 and Jersey JAX-RS implementations out of the box.
Were there any dependency upgrades?
Spring Boot 1.4 is built on the solid foundation of Spring Framework 4.3, which itself brings numerous improvements and new features. This is a mandatory upgrade that unlocks new programming models within Boot.
Hibernate 5.2 is now the default JPA provider, bringing its own set of performance and standards compliance improvements. The build tool plugins for both Gradle and Maven have also been updated with new capabilities and fixes.
FAQ
How do I replace CRaSH shell support now that it's deprecated?
CRaSH support has been removed in favor of other alternatives. For shell access, you might consider integrating SSH libraries directly or using other remote management endpoints provided by Spring Boot's actuator.
What is the purpose of the new @JsonTest annotation?@JsonTest auto-configures a sliced application context focused solely on JSON testing. It sets up Jackson ObjectMapper, @JsonComponent beans, and supports JsonContent and BasicJsonTester for fluent assertions.
Does @MockBean work with different testing frameworks?
Yes, @MockBean and @SpyBean are designed to work with both JUnit and TestNG. They are part of the Spring TestContext Framework, not tied to a specific runner.
I use the legacy JAR layout. What should I do?
The spring-boot-legacy module for traditional WAR layout is deprecated. You should plan to migrate to the standard executable jar or war layout that Spring Boot provides by default.
Can I still use Tomcat 8.0 with Spring Boot 1.4?
While Tomcat 8.5 is now the default and recommended version, you can still override the dependency to use Tomcat 8.0. However, you should upgrade to 8.5 for the latest features and security patches.