๋ฐ์ํ
๐จ ๋ฌธ์ ์ํฉ
WeproApplicationTests > contextLoads() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180
Caused by: org.springframework.jdbc.UncategorizedSQLException at JdbcTemplate.java:1549
Caused by: java.sql.BatchUpdateException at SQLError.java:223
Caused by: java.sql.SQLException at SQLError.java:130
github action์์ workflow๋ฅผ ๋๋ ค๋ดค๋๋ฐ build ํ ๋ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
SQL ์๋ฌ๋ ํ์คํ๋ฐ, ์ ํํ๊ฒ ์ด๋ ๋ถ๋ถ์์ ์ค๋ฅ๊ฐ ๋ ๊ฑด์ง ์ ์ ์์์ต๋๋ค.
โ ํด๊ฒฐ ๋ฐฉ๋ฒ
์ด๋ฐ ๊ฒฝ์ฐ, ์๋ฌ ๋ฉ์์ง๋ฅผ ์์ธํ ๋ณด๊ธฐ ์ํด ์ถ๊ฐํ ์ ์๋ ์ค์ !
build. gradle์ ๋ค์๊ณผ ๊ฐ์ด ์ถ๊ฐํด ์ฃผ์๋ฉด ๋ฉ๋๋ค.
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
๋ค์ workflow๋ฅผ ๋๋ ค๋ณด๋ฉด
WeproApplicationTests > contextLoads() FAILED
java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@605000d4 ...
...
Caused by:
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO question (content, category_type, options, created_at, updated_at) VALUES (?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1364]; Field 'id' doesn't have a default value
...
์ ํํ๊ฒ ์ด๋์ ์๋ฌ๊ฐ ๋ฐ์ํ๋์ง ์ ๋์ต๋๋ค!
์ ๊ฐ์ ๊ฒฝ์ฐ, Question ์ํฐํฐ์ id์ @GeneratedValue(strategy = GenerationType.IDENTITY)๋ฅผ ํด์ฃผ์ง ์์ batch insert ํ ๋ id ๊ฐ์ด ์์ด ์ค๋ฅ๊ฐ ๋๋ ๊ฒ์ด์์ต๋๋ค..ใ ใ
๋ฐ์ํ
'๐ฏ Programming' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ISSUE] error: connect econnrefused (1) | 2025.02.17 |
---|---|
[JAVA] ์ค๋ณต ์ ๊ฑฐ ๋ฐฉ๋ฒ(+์ ๋ ฌ) (1) | 2025.01.31 |
[ISSUE] boolean์์ is๊ฐ ์๋ต๋๋ ๋ฌธ์ (0) | 2024.09.06 |
์ธํฐํ์ด์ค(Interface) vs ์ถ์ ํด๋์ค(Abstract class) (0) | 2024.05.25 |