java-tutorials/spring-4/src/test/java/com/baeldung/hikari/HikariIntegrationTest.java

29 lines
843 B
Java

package com.baeldung.hikari;
import static org.junit.Assert.*;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(
// instead of setting this property, we can exclude the dependency to org.apache.tomcat:tomcat-jdbc in pom.xml
properties = "spring.datasource.type=com.zaxxer.hikari.HikariDataSource")
public class HikariIntegrationTest {
@Autowired
private DataSource dataSource;
@Test
public void hikariConnectionPoolIsConfigured() {
assertEquals("com.zaxxer.hikari.HikariDataSource", dataSource.getClass()
.getName());
}
}