DATAJDBC-346 - Fixed test failures when using MSSQL database.
Original pull request: #144.
This commit is contained in:
committed by
Jens Schauder
parent
082eafb62d
commit
1481803ab9
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.jdbc.core;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.tuple;
|
||||
|
||||
import lombok.Value;
|
||||
import lombok.experimental.Wither;
|
||||
|
||||
import org.assertj.core.api.SoftAssertions;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Rule;
|
||||
@@ -34,6 +34,7 @@ import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.jdbc.testing.TestConfiguration;
|
||||
import org.springframework.data.relational.core.conversion.RelationalConverter;
|
||||
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.rules.SpringClassRule;
|
||||
import org.springframework.test.context.junit4.rules.SpringMethodRule;
|
||||
@@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@Transactional
|
||||
@ActiveProfiles("hsql")
|
||||
public class ImmutableAggregateTemplateHsqlIntegrationTests {
|
||||
|
||||
@ClassRule public static final SpringClassRule classRule = new SpringClassRule();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.jdbc.repository;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Rule;
|
||||
@@ -33,6 +33,7 @@ import org.springframework.data.relational.core.mapping.RelationalMappingContext
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.rules.SpringClassRule;
|
||||
import org.springframework.test.context.junit4.rules.SpringMethodRule;
|
||||
@@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@Transactional
|
||||
@ActiveProfiles("hsql")
|
||||
public class JdbcRepositoryCrossAggregateHsqlIntegrationTests {
|
||||
|
||||
private static final long TWO_ID = 23L;
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.springframework.data.jdbc.testing.TestConfiguration;
|
||||
import org.springframework.data.relational.core.mapping.event.BeforeSaveEvent;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.rules.SpringClassRule;
|
||||
import org.springframework.test.context.junit4.rules.SpringMethodRule;
|
||||
@@ -52,6 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@Transactional
|
||||
@ActiveProfiles("hsql")
|
||||
public class JdbcRepositoryWithCollectionsAndManuallyAssignedIdHsqlIntegrationTests {
|
||||
|
||||
static AtomicLong id = new AtomicLong(0);
|
||||
|
||||
@@ -193,8 +193,10 @@ public class EnableJdbcAuditingHsqlIntegrationTests {
|
||||
|
||||
return (Consumer<R> test) -> {
|
||||
|
||||
try (ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(configurationClasses)) {
|
||||
|
||||
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) {
|
||||
context.getEnvironment().setActiveProfiles("hsql");
|
||||
context.register(configurationClasses);
|
||||
context.refresh();
|
||||
test.accept(context.getBean(repositoryType));
|
||||
|
||||
softly.assertAll();
|
||||
@@ -236,6 +238,7 @@ public class EnableJdbcAuditingHsqlIntegrationTests {
|
||||
|
||||
@ComponentScan("org.springframework.data.jdbc.testing")
|
||||
@EnableJdbcRepositories(considerNestedRepositories = true)
|
||||
@ActiveProfiles("hsql")
|
||||
static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user