Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,6 @@ public ResponseEntity<Object> placeAuctionBid(
return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
.body("You are suspended and cannot place a bid");
}
member.addPurchaseToWishlist(storeService.getAuctionByProductId(storeId, productId)); // productId ->
// purchase
String previousBidder = storeService.placeBidForAuction(storeId, productId, member.getEmail(), bidAmount);
if (previousBidder != null) {
Expand All @@ -1928,6 +1927,10 @@ public ResponseEntity<Object> placeAuctionBid(
String.format("You have been outbid. New highest bid is %.2f", bidAmount), storeId);
log.info("Previous bidder {} notified of new bid", previousBidder);
}
else{
member.addPurchaseToWishlist(storeService.getAuctionByProductId(storeId, productId)); // productId ->

}

return ResponseEntity.ok("Bid placed successfully");
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void GivenInvalidProductId_WhenPlacingAuctionBid_ThenBidFails() throws Exception
.param("productId", "nonexistent-product")
.param("bidAmount", "120.0"))
.andExpect(status().isInternalServerError())
.andExpect(content().string(containsString("Auction not found here")));
.andExpect(content().string(containsString("Auction does not exist")));
}

// @Test
Expand Down