Merge branch '2.7.x'

This commit is contained in:
Stephane Nicoll
2022-02-05 14:02:00 +01:00
17 changed files with 104 additions and 62 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfigurati
import org.springframework.context.ApplicationContext;
import org.springframework.data.repository.config.BootstrapMode;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.TestPropertySource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -41,7 +40,6 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
* @author Scott Frederick
*/
@DataJpaTest
@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false")
class DataJpaTestIntegrationTests {
@Autowired
@@ -71,6 +69,7 @@ class DataJpaTestIntegrationTests {
@Test
void testEntityManagerPersistAndGetId() {
Long id = this.entities.persistAndGetId(new ExampleEntity("spring", "123"), Long.class);
this.entities.flush();
assertThat(id).isNotNull();
String reference = this.jdbcTemplate.queryForObject("SELECT REFERENCE FROM EXAMPLE_ENTITY WHERE ID = ?",
String.class, id);