File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
spring-boot-3-demo-app-kotlin/src/test/kotlin/io/github/mfvanek/spring/boot3/kotlin/test
spring-boot-3-demo-app/src/test/java/io/github/mfvanek/spring/boot3/test Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ import org.junit.jupiter.api.DisplayName
1414import org.junit.jupiter.api.Test
1515import org.springframework.beans.factory.annotation.Autowired
1616import org.springframework.context.ApplicationContext
17- import org.springframework.dao.DataAccessResourceFailureException
18- import java.util.Locale
17+ import org.springframework.dao.QueryTimeoutException
18+ import java.util.*
1919import java.util.function.Consumer
2020
2121class ApplicationTests : TestBase () {
@@ -70,7 +70,7 @@ class ApplicationTests : TestBase() {
7070 @DisplayName(" Throws exception when query exceeds timeout" )
7171 fun exceptionWithLongQuery () {
7272 assertThatThrownBy { jdbcTemplate.execute(" select pg_sleep(1.1);" ) }
73- .isInstanceOf(DataAccessResourceFailureException ::class .java)
73+ .isInstanceOf(QueryTimeoutException ::class .java)
7474 .hasMessageContaining(" ERROR: canceling statement due to user request" )
7575 }
7676
Original file line number Diff line number Diff line change 1818import org .junit .jupiter .api .Test ;
1919import org .springframework .beans .factory .annotation .Autowired ;
2020import org .springframework .context .ApplicationContext ;
21- import org .springframework .dao .DataAccessResourceFailureException ;
21+ import org .springframework .dao .QueryTimeoutException ;
2222
2323import java .util .Locale ;
2424
@@ -66,7 +66,7 @@ void jdbcQueryTimeoutFromProperties() {
6666 @ DisplayName ("Throws exception when query exceeds timeout" )
6767 void exceptionWithLongQuery () {
6868 assertThatThrownBy (() -> jdbcTemplate .execute ("select pg_sleep(1.1);" ))
69- .isInstanceOf (DataAccessResourceFailureException .class )
69+ .isInstanceOf (QueryTimeoutException .class )
7070 .hasMessageContaining ("ERROR: canceling statement due to user request" );
7171 }
7272
You can’t perform that action at this time.
0 commit comments