[Spring/Security] Firebase๋ฅผ ํ™œ์šฉํ•œ ์ธ์ฆ ๊ตฌํ˜„
ยท
Backend/Spring Boot
ํ”„๋กœ์ ํŠธ์˜ ์ด์ „ ๋ฒ„์ „์—๋Š” ๋”ฐ๋กœ ๋ฐฑ์—”๋“œ ์„œ๋ฒ„๊ฐ€ ์—†์—ˆ๊ณ , React Native์—์„œ Firebase๋ฅผ ์ด์šฉํ•ด ์†Œ์…œ ๋กœ๊ทธ์ธ์„ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. ๋‚˜๋Š” ์ดํ›„ ํ”„๋กœ์ ํŠธ์— ํ•ฉ๋ฅ˜ํ•ด Spring์œผ๋กœ ๋‹ค๋ฅธ ์„œ๋ฒ„๋ฅผ ๊ฐœ๋ฐœํ•˜๊ณ  ์žˆ๋‹ค. ๋ฐฑ์—”๋“œ์—์„œ๋„ ์‚ฌ์šฉ์ž๋ฅผ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด Firebase๋กœ ๋ฐœ๊ธ‰๋œ ํ† ํฐ์„ ์‚ฌ์šฉํ•ด์•ผ ํ–ˆ๋‹ค.  ๊ตฌํ˜„์„ ์œ„ํ•ด Firebase Token์— ๋Œ€ํ•ด ์ดํ•ดํ•˜๋Š” ๊ณผ์ •์ด ํ•„์š”ํ–ˆ๊ณ , ํ† ํฐ์„ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด Spring Security๋„ ๊ณต๋ถ€ํ•ด์•ผ ๋๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ตœ์ข…์ ์œผ๋กœ firebase๊ฐ€ ํฌํ•จ๋œ ์„œ๋ฒ„๋ฅผ ๋ฐฐํฌํ•˜๊ธฐ๊นŒ์ง€ ๋งŽ์€ ์‚ฝ์งˆ์„ ํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. ๊ตฌํ˜„ํ•˜๋ฉด์„œ ๊ณต๋ถ€ํ–ˆ๋˜ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜๊ณ , ๊ตฌํ˜„ ๊ณผ์ •์„ ๊ณต์œ ํ•˜๊ณ ์ž ํ•œ๋‹ค!     Firebase Token? ์šฐ์„  Firebase Token์— ๋Œ€ํ•ด ์•Œ์•„์•ผ ํ•œ๋‹ค. Firebase Authe..
LeetCode 127 : Word Ladder(๋‹จ์–ด ์‚ฌ๋‹ค๋ฆฌ/๋‹จ์–ด ๋ณ€ํ™˜)
ยท
Algorithm/LeetCode
https://leetcode.com/problems/word-ladder/description/   ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์— ์žˆ๋Š” '๋‹จ์–ด ๋ณ€ํ™˜' ๋ฌธ์ œ์™€ ๋˜‘๊ฐ™์€ ๋ฌธ์ œ์ด๋‹ค. ๋‹ค๋งŒ, ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์— ์žˆ๋Š” ๋ฌธ์ œ๋Š” ๋‹จ์–ด์˜ ๊ฐœ์ˆ˜๊ฐ€ ์ตœ๋Œ€ 50๊ฐœ๋กœ, ์ตœ๋Œ€ ๋‹จ์–ด ๊ฐœ์ˆ˜๊ฐ€ 5000๊ฐœ์ธ LeetCode์™€๋Š” ์ฐจ์ด๊ฐ€ ์žˆ๋‹ค.  ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์—์„œ ๋จผ์ € ํ’€๊ณ , ๋‹จ์–ด ๊ฐœ์ˆ˜๊ฐ€ ํฐ LeetCode์—์„œ ์ ์  ์ตœ์ ํ™”๋ฅผ ํ•˜๋ฉด์„œ ํ’€์—ˆ๋‹ค.     ๋ฌธ์ œ(ํ•œ๊ตญ์–ด ๋ฒˆ์—ญ) ๋‹จ์–ด ์‚ฌ์ „์ธ `wordList`๋ฅผ ์ด์šฉํ•ด `beginWord`์—์„œ `endWord`๊นŒ์ง€ ๋ณ€ํ™˜ํ•˜๋Š” ์‹œํ€€์Šค๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.`beginWord -> S1 -> S2 -> ... -> Sk` ๋ชจ๋“  ์ธ์ ‘ํ•˜๋Š” ๋‹จ์–ด ์Œ์€ ํ•œ ๊ธ€์ž๋งŒ ๋‹ค๋ฅด๋‹ค.๋ชจ๋“  ๋‹จ์–ด๋Š” `wordList`์— ์†ํ•œ๋‹ค. `beginWord`๋Š” `w..
[Project/4th] ์ง€์—ญ ๊ธฐ๋ฐ˜ ๊ฒŒ์‹œ๊ธ€ ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
ยท
Project
ํ”„๋กœ์ ํŠธ์—์„œ ์ง€์—ญ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ตฌ์ธ๊ตฌ์ง ๊ฒŒ์‹œ๊ธ€์„ ๋“ฑ๋กํ•˜๊ณ  ๊ฒ€์ƒ‰ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค.  ์ด ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๊ธฐ ์œ„ํ•ด ์„ค๊ณ„์— ๋งŽ์€ ๊ณ ๋ฏผ์„ ํ–ˆ๊ณ , ๊ตฌํ˜„์— ๋งŽ์€ ์‹œ๊ฐ„์„ ํˆฌ์žํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. ๊ทธ ๊ณผ์ •์„ ๋˜์งš์–ด๋ณด๊ณ  ๊ณต์œ ํ•˜๊ณ ์ž ํ•œ๋‹ค!  ๊ตฌํ˜„์„ ์œ„ํ•ด ๋น„์Šทํ•˜๊ฒŒ ๋™๋„ค ๊ธฐ๋ฐ˜์˜ ์„œ๋น„์Šค(๋‹น๊ทผ๋งˆ์ผ“, ๋ฐฐ๋ฏผ..)์—์„œ ์ด๋Ÿฌํ•œ ๊ธฐ๋Šฅ์„ ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ•˜๋Š”์ง€ ๋งŽ์ด ์ฐพ์•„๋ดค์—ˆ๋‹ค. ์ •ํ™•ํžˆ ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ•˜๋Š”์ง€๋Š” ์•Œ ์ˆ˜ ์—†์—ˆ์ง€๋งŒ, ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์˜ ๋‹น๊ทผ๋งˆ์ผ“ ํด๋ก  ์ฝ”๋”ฉ๊ณผ ์—ฌ๋Ÿฌ ํ…Œํฌ ๋ธ”๋กœ๊ทธ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ๋‚˜๋ฆ„๋Œ€๋กœ ๋‚ด ์ˆ˜์ค€์— ๋งž๊ฒŒ ํ•ด๋‹น ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.     ๊ธฐ๋Šฅ ์†Œ๊ฐœ  ๊ตฌ์ธ๊ตฌ์ง ๊ฒŒ์‹œ๊ธ€ ๋“ฑ๋ก๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑ ์‹œ, ๊ตฌ์ธ๊ตฌ์ง์˜ ์ƒ์„ธ ์กฐ๊ฑด๊ณผ ๊ฑฐ์  ์ง€์—ญ(ex. ์„œ์šธํŠน๋ณ„์‹œ ๊ฐ•๋‚จ๊ตฌ ์—ญ์‚ผ๋™)์„ ์ž…๋ ฅํ•œ๋‹ค. ๊ตฌ์ธ๊ตฌ์ง ๊ฒŒ์‹œ๊ธ€ ๊ฒ€์ƒ‰๊ฒŒ์‹œ๊ธ€ ๊ฒ€์ƒ‰ ์‹œ, ๊ฑฐ์  ์ง€์—ญ(ex. ์„œ์šธํŠน๋ณ„์‹œ ๊ฐ•๋‚จ..
[Spring/JUnit] Mock ๊ฐ์ฒด ์„ค์ • ๋ฌธ์ œ : java.lang.AssertionError: Expecting actual not to be null
ยท
Backend/Spring Boot
โ—๏ธ์—๋Ÿฌ ๋ฉ”์‹œ์ง€java.lang.AssertionError: Expecting actual not to be null     ๐Ÿ’ป ๊ฐœ๋ฐœ ํ™˜๊ฒฝFramework : Spring Boot `3.2.3`DB : MySQL(๋กœ์ปฌ), H2(ํ…Œ์ŠคํŠธ)Library : JPA, QueryDSL `5.0.0`Test : JUnit     ๐Ÿ”Ž ์›์ธSpring์—์„œ Junit์œผ๋กœ Service ๋‹จ์˜ ๊ฒŒ์‹œ๊ธ€ ๋“ฑ๋ก ๊ธฐ๋Šฅ์„ ํ…Œ์ŠคํŠธํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค.๊ฒŒ์‹œ๊ธ€ ๋“ฑ๋ก ๋ฉ”์†Œ๋“œ๋Š” `save()`๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ์ƒˆ๋กœ ๋“ฑ๋ก๋œ ๊ฒŒ์‹œ๊ธ€์˜ `id`๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. ์ด๋ฅผ ํ…Œ์ŠคํŠธํ•˜๊ธฐ ์œ„ํ•ด Mock ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด `save()`๋ฅผ ์ˆ˜ํ–‰ํ•˜๋ฉด ๋ฐ˜ํ™˜ํ•˜๋„๋ก ํ–ˆ๊ณ , `getId()`๋ฅผ ํ˜ธ์ถœํ•˜๋ฉด `id`๋กœ 1L์„ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ์„ค์ •ํ–ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ฒŒ์‹œ๊ธ€ ๋“ฑ๋ก ๋ฉ”์†Œ๋“œ๋ฅผ ์‹คํ–‰ํ–ˆ์„..
[Spring/JUnit] H2 ์˜ˆ์•ฝ์–ด user ๋•Œ๋ฌธ์— ๋ฐœ์ƒ : Error executing DDL "drop table if exists user cascade " via JDBC [Syntax error in SQL statement "drop table if exists [*]user cascade "; expected "identifier";]
ยท
Backend/Spring Boot
โ—๏ธ์—๋Ÿฌ ๋ฉ”์‹œ์ง€Error executing DDL "drop table if exists user cascade " via JDBC [Syntax error in SQL statement "drop table if exists [*]user cascade "; expected "identifier";]     ๐Ÿ’ป ๊ฐœ๋ฐœ ํ™˜๊ฒฝFramework : Spring Boot`3.2.3`DB : MySQL(๋กœ์ปฌ), H2(ํ…Œ์ŠคํŠธ)Library : JPA, QueryDSL`5.0.0`Test : JUnit     ๐Ÿ”Ž ์›์ธSpring์—์„œ JPA Repository ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค.DB๋Š” ๋กœ์ปฌ์—์„œ ๊ฐœ๋ฐœ์„ ์œ„ํ•ด MySQL์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€๋งŒ, ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด์„œ ๋‚ด์žฅํ˜• ์ธ๋ฉ”๋ชจ๋ฆฌ DB์ธ H2๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. ..
[Spring/JUnit] DataJpaTest์—์„œ JPAQueryFactory Bean ๋“ฑ๋ก ์—๋Ÿฌ : No qualifying bean of type 'com.querydsl.jpa.impl.JPAQueryFactory' available
ยท
Backend/Spring Boot
Spring์—์„œ JPA์™€ QueryDSL์„ ์‚ฌ์šฉํ•˜์—ฌ DB์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๊ณ  ์žˆ์—ˆ๋‹ค.๊ทธ๋ฆฌ๊ณ  Repository ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค.     ๐Ÿ’ป ๊ฐœ๋ฐœ ํ™˜๊ฒฝFramework : Spring Boot `3.2.3`DB : MySQL, H2Library : JPA, QueryDSL `5.0.0`Test : JUnit     โ—๏ธ์—๋Ÿฌ ๋ฉ”์‹œ์ง€Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXXCustomRepositoryImpl' defined in file [.../repository/XXXCustomRepositoryImpl.class]: Unsati..
giraffe_
'๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก