사용할 DB에 대한 런타임의존성을 설정해준다.
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/{db명}
username: {username}
password: {password}
driver-class-name: com.mysql.jdbc.Driver
jpa:
show-sql: true
hibernate:
ddl-auto: create # 테스트용 DB 생성(실제 운영시 동일하게 사용하면, 애플리케이션 재기동시마다 삭제됨)
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2)
public class InactvieUserJobTest {
}