Skip to content

Commit

Permalink
[fix] 테스트 코드 오타 수정 (#342)
Browse files Browse the repository at this point in the history
* #333 feat: 포트폴리오 종목 조회 및 sse 응답의 프로퍼티 수정

- id 추가

* test: 테스트 코드 오타 수정
  • Loading branch information
yonghwankim-dev authored May 24, 2024
1 parent c041cd1 commit 39b8a4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void readMyPortfolioStocks() throws Exception {
resultActions
.andExpect(jsonPath("data.portfolioHoldings[0].companyName").value(equalTo("삼성전자보통주")))
.andExpect(jsonPath("data.portfolioHoldings[0].tickerSymbol").value(equalTo("005930")))
.andExpect(jsonPath("data.portfolioHoldings[0].portfolioHoldingId").value(equalTo(1)))
.andExpect(jsonPath("data.portfolioHoldings[0].id").value(equalTo(1)))
.andExpect(jsonPath("data.portfolioHoldings[0].currentValuation").value(equalTo(180000)))
.andExpect(jsonPath("data.portfolioHoldings[0].currentPrice").value(equalTo(60000)))
.andExpect(jsonPath("data.portfolioHoldings[0].averageCostPerShare").value(equalTo(50000)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,34 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;

import codesquad.fineants.AbstractContainerBaseTest;
import codesquad.fineants.domain.common.count.Count;
import codesquad.fineants.domain.common.money.Bank;
import codesquad.fineants.domain.common.money.Currency;
import codesquad.fineants.domain.common.money.Expression;
import codesquad.fineants.domain.common.money.Money;
import codesquad.fineants.domain.common.money.Percentage;
import codesquad.fineants.domain.common.money.RateDivision;
import codesquad.fineants.domain.kis.client.KisCurrentPrice;
import codesquad.fineants.domain.kis.repository.ClosingPriceRepository;
import codesquad.fineants.domain.kis.repository.CurrentPriceRepository;
import codesquad.fineants.domain.member.domain.entity.Member;
import codesquad.fineants.domain.member.repository.MemberRepository;
import codesquad.fineants.domain.oauth.support.AuthMember;
import codesquad.fineants.domain.portfolio.domain.entity.Portfolio;
import codesquad.fineants.domain.portfolio.repository.PortfolioRepository;
import codesquad.fineants.domain.portfolio_gain_history.repository.PortfolioGainHistoryRepository;
import codesquad.fineants.domain.portfolio_holding.domain.dto.request.PortfolioHoldingCreateRequest;
import codesquad.fineants.domain.portfolio_holding.domain.dto.request.PortfolioStocksDeleteRequest;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioChartResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioDetailResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioHoldingsRealTimeResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioHoldingsResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockCreateResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockDeleteResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockDeletesResponse;
import codesquad.fineants.domain.portfolio_holding.domain.entity.PortfolioHolding;
import codesquad.fineants.domain.portfolio_holding.event.publisher.PortfolioHoldingEventPublisher;
import codesquad.fineants.domain.portfolio_holding.repository.PortfolioHoldingRepository;
import codesquad.fineants.domain.purchase_history.domain.entity.PurchaseHistory;
import codesquad.fineants.domain.purchase_history.repository.PurchaseHistoryRepository;
Expand All @@ -38,23 +52,9 @@
import codesquad.fineants.domain.stock.repository.StockRepository;
import codesquad.fineants.domain.stock_dividend.domain.entity.StockDividend;
import codesquad.fineants.domain.stock_dividend.repository.StockDividendRepository;
import codesquad.fineants.AbstractContainerBaseTest;
import codesquad.fineants.global.errors.exception.FineAntsException;
import codesquad.fineants.global.errors.exception.ForBiddenException;
import codesquad.fineants.global.errors.exception.NotFoundResourceException;
import codesquad.fineants.domain.kis.client.KisCurrentPrice;
import codesquad.fineants.domain.kis.repository.CurrentPriceRepository;
import codesquad.fineants.domain.kis.repository.ClosingPriceRepository;
import codesquad.fineants.domain.portfolio_holding.event.publisher.PortfolioHoldingEventPublisher;
import codesquad.fineants.domain.portfolio_holding.domain.dto.request.PortfolioHoldingCreateRequest;
import codesquad.fineants.domain.portfolio_holding.domain.dto.request.PortfolioStocksDeleteRequest;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioChartResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioDetailResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioHoldingsRealTimeResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioHoldingsResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockCreateResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockDeleteResponse;
import codesquad.fineants.domain.portfolio_holding.domain.dto.response.PortfolioStockDeletesResponse;
import codesquad.fineants.global.util.ObjectMapperUtil;

class PortfolioHoldingServiceTest extends AbstractContainerBaseTest {
Expand Down Expand Up @@ -173,7 +173,7 @@ void readMyPortfolioStocks() {
() -> assertThat(response.getPortfolioHoldings())
.hasSize(1)
.extracting("portfolioHolding")
.extracting("portfolioHoldingId", "currentValuation", "currentPrice", "averageCostPerShare",
.extracting("id", "currentValuation", "currentPrice", "averageCostPerShare",
"numShares", "dailyChange", "dailyChangeRate", "totalGain", "totalReturnRate", "annualDividend")
.usingComparatorForType(Money::compareTo, Money.class)
.usingComparatorForType(Count::compareTo, Count.class)
Expand Down

0 comments on commit 39b8a4c

Please sign in to comment.