Skip to content

Commit

Permalink
refactor: 사용하지 않는 메서드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonyj1022 committed Nov 23, 2023
1 parent 8b0526d commit 65d217b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
import com.ddang.ddang.bid.domain.Bid;

import java.util.List;
import java.util.Optional;

public interface BidRepository {

Bid save(final Bid bid);

List<Bid> findAllByAuctionId(final Long auctionId);

Optional<Bid> findLastBidByAuctionId(final Long auctionId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
@RequiredArgsConstructor
Expand All @@ -23,9 +22,4 @@ public Bid save(final Bid bid) {
public List<Bid> findAllByAuctionId(final Long auctionId) {
return jpaBidRepository.findAllByAuctionIdOrderByIdAsc(auctionId);
}

@Override
public Optional<Bid> findLastBidByAuctionId(final Long auctionId) {
return jpaBidRepository.findLastBidByAuctionId(auctionId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.springframework.context.annotation.Import;

import java.util.List;
import java.util.Optional;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -56,13 +55,4 @@ void setUp(@Autowired final JpaBidRepository jpaBidRepository) {
softAssertions.assertThat(actual.get(1).getId()).isEqualTo(경매1_입찰2_마지막_입찰.getId());
});
}

@Test
void 특정_경매의_마지막_입찰을_조회한다() {
// when
final Optional<Bid> actual = bidRepository.findLastBidByAuctionId(경매1.getId());

// then
assertThat(actual.get().getId()).isEqualTo(경매1_입찰2_마지막_입찰.getId());
}
}

0 comments on commit 65d217b

Please sign in to comment.