[BAEL-10897] - Fixed tomcat connection pool issue and CarRepositoryIntegrationTest
This commit is contained in:
parent
0b7d4a4d64
commit
4195b7e406
|
@ -25,6 +25,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.zaxxer</groupId>
|
||||||
|
<artifactId>HikariCP</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.baeldung.exists;
|
package com.baeldung.boot.domain;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
|
@ -17,7 +17,7 @@ public class Car {
|
||||||
private Integer power;
|
private Integer power;
|
||||||
private String model;
|
private String model;
|
||||||
|
|
||||||
Car() {
|
public Car() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package com.baeldung.exists;
|
package com.baeldung.boot.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.baeldung.boot.domain.Car;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author paullatzelsperger
|
* @author paullatzelsperger
|
||||||
* @since 2019-03-20
|
* @since 2019-03-20
|
|
@ -13,11 +13,15 @@ import org.springframework.data.domain.Example;
|
||||||
import org.springframework.data.domain.ExampleMatcher;
|
import org.springframework.data.domain.ExampleMatcher;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import com.baeldung.boot.Application;
|
||||||
|
import com.baeldung.boot.domain.Car;
|
||||||
|
import com.baeldung.boot.repository.CarRepository;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest
|
@SpringBootTest(classes = {Application.class})
|
||||||
public class CarRepositoryIntegrationTest {
|
public class CarRepositoryIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -20,6 +20,6 @@ public class SpringBootTomcatConnectionPoolIntegrationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenTomcatConnectionPoolInstance_whenCheckedPoolClassName_thenCorrect() {
|
public void givenTomcatConnectionPoolInstance_whenCheckedPoolClassName_thenCorrect() {
|
||||||
assertThat(dataSource.getClass().getName()).isEqualTo("com.zaxxer.hikari.HikariDataSource");
|
assertThat(dataSource.getClass().getName()).isEqualTo("org.apache.tomcat.jdbc.pool.DataSource");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue