Make postgres data.sql properly idempotent

Fixes #936
This commit is contained in:
Dave Syer 2022-04-19 08:43:51 +00:00 committed by GitHub
parent d381fb658c
commit 5ecaccffe9
2 changed files with 44 additions and 42 deletions

View file

@ -37,6 +37,7 @@ import org.springframework.samples.petclinic.owner.Visit;
import org.springframework.samples.petclinic.vet.Vet;
import org.springframework.samples.petclinic.vet.VetRepository;
import org.springframework.stereotype.Service;
import org.springframework.test.context.TestPropertySource;
import org.springframework.transaction.annotation.Transactional;
/**
@ -70,6 +71,7 @@ import org.springframework.transaction.annotation.Transactional;
@DataJpaTest(includeFilters = @ComponentScan.Filter(Service.class))
// Ensure that if the mysql profile is active we connect to the real database:
@AutoConfigureTestDatabase(replace = Replace.NONE)
// @TestPropertySource("/application-postgres.properties")
class ClinicServiceTests {
@Autowired