Skip to content

Commit

Permalink
Merge pull request #76 from ClothingStoreService/refactor/update-prod…
Browse files Browse the repository at this point in the history
…uct-category-test-repository

refactor: Mybatis , JPA 변환 Adapter 적용에 따른 테스트 코드  변경
  • Loading branch information
Ogu1208 authored Jul 2, 2024
2 parents e24c17c + 8d83754 commit a1cb42f
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 a1cb42f

Please sign in to comment.