Skip to content

Commit

Permalink
refactor: Mybatis , JPA 변환 Adapter 적용에 따른 테스트 코드 변경
Browse files Browse the repository at this point in the history
- Mybatis , JPA 변환 을 위한 Adapter 적용함에 따라 Product, ProductLine 의 테스트코드의 레포지토리 의존성을 변경하였습니다.
  • Loading branch information
Ogu1208 committed Jul 2, 2024
1 parent e24c17c commit 8d83754
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public void updateStock(long stock) {
checkAndUpdateProductLineStatus();
}

// 재고를 차감하고 상태를 변경하는 메서드
public void reduceStock(int quantity) {
if (this.stock >= quantity) {
this.stock -= quantity;
Expand All @@ -60,7 +59,6 @@ public void reduceStock(int quantity) {
}
}

// 재고 변경 시 ProductLine 상태 업데이트 메서드
private void checkAndUpdateProductLineStatus() {
if (productLine != null) {
productLine.checkAndUpdateStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.store.clothstar.product.dto.request.UpdateProductRequest;
import org.store.clothstar.product.dto.response.ProductResponse;
import org.store.clothstar.product.repository.ProductMybatisRepository;
import org.store.clothstar.product.repository.ProductRepository;

import java.util.Optional;

Expand All @@ -29,7 +30,7 @@ class ProductServiceTest {
private ProductService productService;

@Mock
private ProductMybatisRepository productMybatisRepository;
private ProductRepository productMybatisRepository;

@DisplayName("product_id로 상품 옵션 단건 조회에 성공한다.")
@Test
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.store.clothstar.productLine.dto.response.ProductLineResponse;
import org.store.clothstar.productLine.dto.response.ProductLineWithProductsResponse;
import org.store.clothstar.productLine.repository.ProductLineMybatisRepository;
import org.store.clothstar.productLine.repository.ProductLineRepository;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -34,7 +35,7 @@ class ProductLineServiceTest {
private ProductLineService productLineService;

@Mock
private ProductLineMybatisRepository productLineMybatisRepository;
private ProductLineRepository productLineMybatisRepository;

@DisplayName("상품 리스트 조회에 성공한다.")
@Test
Expand Down

0 comments on commit 8d83754

Please sign in to comment.