#186 - Prepare upgrade to Spring Boot 1.4 M2 and Hibernate 5.

Upgraded to Spring Boot 1.4 M2 and thus Hibernate 5.1 transitively.
Switched to H2 as database for all examples using JPA by accident as the
invalid error logging for HSQLDB schema creation got worse in 5.1 (see
[0]). The JPA examples themselves have to stay on HSQLDB as H2 doesn't
support stored procedures. The stored procedures example in turn has to
be downgraded to 5.0.7 as all following versions currently break stored
procedure execution support [1]. Reworked the JPA auditing example as
5.1 breaks on generic types used in support types like AbstractAuditable
[2].

Tweaked content type assertions in some REST related test cases as
Spring 4.3 returns an encoding alongside the media type.

[0] https://hibernate.atlassian.net/browse/HHH-10605
[1] https://hibernate.atlassian.net/browse/HHH-10515
[2] https://hibernate.atlassian.net/browse/HHH-10514
This commit is contained in:
Oliver Gierke
2016-04-11 16:09:36 +02:00
parent 763710ddc9
commit 2314c6e726
13 changed files with 73 additions and 118 deletions

View File

@@ -21,24 +21,20 @@ import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.annotation.Transactional;
import example.springdata.jpa.auditing.AuditableUser;
import example.springdata.jpa.auditing.AuditableUserRepository;
import example.springdata.jpa.auditing.AuditingConfiguration;
import example.springdata.jpa.auditing.AuditorAwareImpl;
/**
* @author Oliver Gierke
* @author Thomas Darimont
*/
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
@ContextConfiguration(classes = AuditingConfiguration.class)
@SpringBootTest(classes = AuditingConfiguration.class)
public class AuditableUserSample {
@Autowired AuditableUserRepository repository;
@@ -58,7 +54,7 @@ public class AuditableUserSample {
user = repository.save(user);
user = repository.save(user);
assertEquals(user, user.getCreatedBy());
assertEquals(user, user.getLastModifiedBy());
assertThat(user.getCreatedBy(), is(user));
assertThat(user.getLastModifiedBy(), is(user));
}
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="error" />
<root level="error">
<appender-ref ref="console" />
</root>
</configuration>