[BAEL-10897] - Fixed tomcat connection pool issue and CarRepositoryIntegrationTest

This commit is contained in:
amit2103 2019-03-29 00:24:14 +05:30
parent 0b7d4a4d64
commit 4195b7e406
5 changed files with 17 additions and 5 deletions

View File

@ -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>

View File

@ -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() {
}

View File

@ -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

View File

@ -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

View File

@ -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");
}
}