Skip to content

Commit 5841f3d

Browse files
committed
Fix tests
1 parent 7cf9837 commit 5841f3d

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

2 files changed

+5
-5
lines changed

spring-boot-3-demo-app-kotlin/src/test/kotlin/io/github/mfvanek/spring/boot3/kotlin/test/ApplicationTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import org.junit.jupiter.api.DisplayName
1414
import org.junit.jupiter.api.Test
1515
import org.springframework.beans.factory.annotation.Autowired
1616
import 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.*
1919
import java.util.function.Consumer
2020

2121
class 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

spring-boot-3-demo-app/src/test/java/io/github/mfvanek/spring/boot3/test/ApplicationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.junit.jupiter.api.Test;
1919
import org.springframework.beans.factory.annotation.Autowired;
2020
import org.springframework.context.ApplicationContext;
21-
import org.springframework.dao.DataAccessResourceFailureException;
21+
import org.springframework.dao.QueryTimeoutException;
2222

2323
import 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

0 commit comments

Comments
 (0)