[BAEL-10897] - Fixed tomcat connection pool issue and CarRepositoryIntegrationTest
This commit is contained in:
parent
0b7d4a4d64
commit
4195b7e406
|
@ -25,6 +25,12 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<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.GeneratedValue;
|
||||
|
@ -17,7 +17,7 @@ public class Car {
|
|||
private Integer power;
|
||||
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.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baeldung.boot.domain.Car;
|
||||
|
||||
/**
|
||||
* @author paullatzelsperger
|
||||
* @since 2019-03-20
|
|
@ -13,11 +13,15 @@ import org.springframework.data.domain.Example;
|
|||
import org.springframework.data.domain.ExampleMatcher;
|
||||
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.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@SpringBootTest(classes = {Application.class})
|
||||
public class CarRepositoryIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -20,6 +20,6 @@ public class SpringBootTomcatConnectionPoolIntegrationTest {
|
|||
|
||||
@Test
|
||||
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