Repository navigation
Spring Boot 1.4.0 M2 Release Notes
For changes in earlier milestones, please refer to:
See instructions in the 1.4.0.M1 release notes for upgrading from v1.3.
Spring Boot 1.4 ships with a new spring-boot-test module that contains a completely reorganized org.springframework.boot.test package. When upgrading a Spring Boot 1.3 application you should migrate from the deprecated classes in the old package to the equivalent class in the new structure. If you’re using Linux or OSX, you can use the following command to migrate code:
find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.OutputCapture/org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/org.springframework.boot.test.web.client.TestRestTemplate/g \
{} \;
Additionally, Spring Boot 1.4 attempts to rationalize and simplify the various ways that a Spring Boot test can be run. You should migrate the following to use the new @SpringBootTest annotation:
-
From
@SpringApplicationConfiguration(classes=MyConfig.class)to@SpringBootTest(classes=MyConfig.class) -
From
@ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class)to@SpringBootTest(classes=MyConfig.class) -
From
@ContextConfiguration(classes=MyConfig.class, loader=SpringApplicationContextLoader.class)to@SpringBootTest(classes=MyConfig.class) -
From
@IntegrationTestto@SpringBootTest(webEnvironment=WebEnvironment.NONE) -
From
@IntegrationTest with @WebAppConfigurationto@SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT)(orRANDOM_PORT) -
From
@WebIntegrationTestto@SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT)(orRANDOM_PORT)
|
Tip
|
Whilst migrating tests you may also want to replace any @RunWith(SpringJUnit4ClassRunner.class) declarations with Spring 4.3’s more readable @RunWith(SpringRunner.class).
|
For more details on the @SpringBootTest annotation refer to the updated documentation.
Hibernate 5.1 is now used as the default JPA persistence provider. If you are upgrading from Spring Boot 1.3 you will be moving from Hibernate 4.3 to Hibernate 5.1. Please refer to Hibernate migration documentation for general upgrade instructions. In addition you should be aware of the following:
-
SpringNamingStrategyis no longer used as Hibernate 5.1 has removed support for the oldNamingStrategyinterface. A newSpringPhysicalNamingStrategyis now auto-configured which is used in combination with Hibernate’s defaultImplicitNamingStrategy. This should be very close to (if not identical) to Spring Boot 1.3 defaults, however, you should check your Database schema is correct when upgrading. -
In order to minimize upgrade pain, we set
hibernate.id.new_generator_mappingsis set tofalsefor Hibernate 5. The Hibernate team generally don’t recommend this setting, so if your happy to deal with generator changes, you might want to setspring.jpa.hibernate.use-new-id-generator-mappingstotruein yourapplication.propertiesfile.
If you have major problems upgrading to Hibernate 5.1 you can downgrade to the older Hibernate version by overriding the hibernate.version property in your pom.xml:
<properties>
<hibernate.version>4.3.11.Final</hibernate.version>
</properties>|
Note
|
Hibernate 4.3 will not be supported past Spring Boot 1.4. Please raise an issue if you find a bug that prevents you from upgrading. |
Spring Boot 1.4 builds on and requires Spring Framework 4.3. There are a number of nice refinements in Spring Framework 4.3 including new Spring MVC @RequestMapping annotations, Refer to the Spring Framework reference documentation for details.
A number of third party libraries have been upgraded to the latest version. Highlights include Hibernate 5.1, Jackson 2.7, Solr 5.5, Spring Data Hopper, Spring Session 1.2 & Hazelcast 3.6.