π 3λ¨κ³ - ν μ€νΈλ₯Ό ν΅ν μ½λ 보νΈ#698
π 3λ¨κ³ - ν
μ€νΈλ₯Ό ν΅ν μ½λ 보νΈ#698jinan159 wants to merge 23 commits intonext-step:jinan159from
Conversation
- μ£Όλ¬Έ μνλ₯Ό νλμ λ³Ό μ μλλ‘ μ£Όλ¬Έ μꡬμ¬ν λ³κ²½
kyucumber
left a comment
There was a problem hiding this comment.
μꡬμ¬ν λ³ λλ½ μμ΄ κΌΌκΌΌνκ³ κΉλνκ² ν μ€νΈλ₯Ό μ μμ±ν΄μ£Όμ κ² κ°λ€μ.
κ°λ¨ν μ½λ©νΈ λ¨κ²¨λμμΌλ νμΈ ν μμ² μ£Όμλ©΄ λ¨Έμ§νλλ‘ νκ² μ΅λλ€. π
| public interface MenuGroupRepository extends JpaRepository<MenuGroup, UUID> { | ||
| public interface MenuGroupRepository { |
There was a problem hiding this comment.
JpaRepositoryμ λλ©μΈμ λ νμ§ν 리λ₯Ό μ λλμ΄μ£Όμ ¨λ€μ π
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| public interface JpaProductRepository extends ProductRepository, JpaRepository<Product, UUID> { |
There was a problem hiding this comment.
ProductRepositoryμ κ°μ λ νμ§ν 리λ€μ΄ λλ©μΈ ν¨ν€μ§μ μλ κ²μ μ΄ν΄κ° κ°λλ°μ, μΈν°νμ΄μ€κΈ΄ νμ§λ§ μ¬μ€μ Jpaμ μ§μ μ°κ΄λμ΄ μκΈ° λλ¬Έμ domain μμμ΄ μλλΌκ³ λ³Ό μ μμ κ² κ°μμ. μ΄μ λν΄ μ΄λ»κ² μκ°νμλμ?
There was a problem hiding this comment.
λ§μνμ λλ‘, Jpa κ΄λ ¨ κΈ°λ₯μ΄λ€ 보λ domain 보λ€λ infra μμμ μλκ² μ΄μΈλ¦΄ κ² κ°μ΅λλ€!
| import kitchenpos.testsupport.FakeMenuGroupRepository | ||
| import kitchenpos.testsupport.MenuGroupFixtures.createMenuGroup | ||
|
|
||
| class MenuGroupServiceFindAllTest : ShouldSpec({ |
There was a problem hiding this comment.
FindAllμ΄λ Createμ κ°μ λ©μλ λ¨μλ‘ λλκ² λλ κ²½μ° μ΄ν λ§μ λ©μλκ° μκΈ°λ©΄ ν μ€νΈ ν΄λμ€κ° λ무 λ§μμ§ κ² κ°μμ.
μ‘°ν / μμ / μμ μ κ°μ λ¨μλ‘ λλκ±°λ νΉμ 볡μ‘λκ° λμμ§λ μμ μ ν΄λμ€ μ체λ₯Ό λλλ κ²λ λ°©λ²μΌ κ² κ°μ΅λλ€.
There was a problem hiding this comment.
μ‘°ν / μμ / μμ λ¨μλ‘ λλκ±°λ, νλλ‘ μμ±νλ€ λ³΅μ‘λκ° λμμ§λ μμ μ λΆλ¦¬νλ λ°©λ²λ μ’λ€κ³ μκ°ν©λλ€!
λ€λ§, κ° κΈ°λ₯(λ©μλ)λ§λ€ νμν Fixture μ μνλ ν
μ€νΈ μ‘°κ±΄μ΄ μ‘°κΈμ© λ¬λΌμ, λΆλ¦¬νκΈ° μν΄ λ³λμ ν΄λμ€λ‘ λλ΄μμ΅λλ€.
μ΄μ²λΌ ν΄λμ€λ₯Ό λ§μ΄ λλκ² λλ©΄ λ°μν μ μλ λ¨μ μ μκ°ν΄λ³΄λ©΄,,
μ λ λΉμ₯ μκ°λλ건 λλ©μΈ λ³κ²½μ΄ λ°μνμλ, μμ ν΄μΌνλ μμμ΄ λ§μμ§ μ μκ² λ€λ μκ°μ΄ λ€μλλ°μ.
νμ§λ§ ν΄λμ€λ₯Ό λλμΌλ‘μ ν
μ€νΈ μμ±κ³Ό κ΄λ¦¬κ° μ©μ΄ν μ₯μ λ μμ΄μ μ λ ν΄λμ€λ₯Ό λλλ μ νμ νμμ΅λλ€.
νΉμ ν μ€νΈ ν΄λμ€κ° λ무 λ§μΌλ©΄ λ μ΄λ€ λ¨μ μ΄ μμκΉμ?
| import kitchenpos.domain.OrderStatus | ||
| import kitchenpos.domain.OrderTable | ||
|
|
||
| class FakeOrderRepository : OrderRepository { |
There was a problem hiding this comment.
Fakeλ₯Ό μ΄μ©ν΄ ν μ€νΈλ₯Ό μ μμ±ν΄μ£Όμ ¨λ€μ. π
κ·λ¨λ μλ νμΈμ.
μκ°μ κΉμ§μ μ λλ€.
μ€λλ§μ 리뷰 μμ² λ립λλ€π
μκ° κ΄κ³μ ν΅ν©ν μ€νΈλ μμ±νμ§ λͺ»νκ³ , μ ν리μΌμ΄μ μλΉμ€μ λ¨μν μ€νΈλ§ μμ±νμ΅λλ€.
μλλ ν μ€νΈ μΌμ΄μ€λ€ μ λλ€. (μ΄ 60κ°)