Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Wie füge ich mode=mysql zu eingebetteter H2-DB in Spring Boot 1.4.1 für @DataJpaTest hinzu?

Festlegen

spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL

in application-test.properties, plus

@RunWith(SpringRunner.class)
@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@ActiveProfiles("test")

in der Testklasse