-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature/BE] 회원을 검색할 때 대표장비가 아닌 다른 제품들도 나오는 오류 수정 (#330)
* refactor: 대표장비 업데이트 로직 수정 Co-authored-by: hamcheeseburger <[email protected]> Co-authored-by: yangdongjue5510 <[email protected]> * [BE] 회원을 검색할 때 대표장비가 아닌 다른 제품들도 나오는 오류 수정 (#329) refactor: 회원 검색 시 대표 장비와 함께 조회되도록 수정 * [BE] 회원 검색 시 대표장비만 조회되도록 수정 코드 리뷰 피드백 반영 (#356) refactor: 코드 리뷰 피드백 반영 Co-authored-by: yh20studio(tiki) <[email protected]> Co-authored-by: hamcheeseburger <[email protected]>
- Loading branch information
1 parent
aaceaf6
commit 00f579f
Showing
7 changed files
with
96 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
backend/src/test/java/com/woowacourse/f12/domain/member/MemberTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.woowacourse.f12.domain.member; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.woowacourse.f12.domain.inventoryproduct.InventoryProduct; | ||
import com.woowacourse.f12.domain.product.Category; | ||
import com.woowacourse.f12.domain.product.Product; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class MemberTest { | ||
|
||
@Test | ||
void getProfileProducts() { | ||
// given | ||
Product keyboard = Product.builder() | ||
.category(Category.KEYBOARD) | ||
.imageUrl("keyboardImage") | ||
.name("keyboard") | ||
.build(); | ||
Product mouse = Product.builder() | ||
.category(Category.MOUSE) | ||
.imageUrl("mouseImage") | ||
.name("mouse") | ||
.build(); | ||
InventoryProduct selectedInventoryProduct = InventoryProduct.builder() | ||
.product(keyboard) | ||
.selected(true) | ||
.build(); | ||
InventoryProduct unselectedInventoryProduct = InventoryProduct.builder() | ||
.product(mouse) | ||
.selected(false) | ||
.build(); | ||
Member member = Member.builder() | ||
.careerLevel(CareerLevel.JUNIOR) | ||
.jobType(JobType.BACKEND) | ||
.gitHubId("githubId") | ||
.imageUrl("imageUrl") | ||
.name("klay") | ||
.inventoryProducts(List.of(selectedInventoryProduct, unselectedInventoryProduct)) | ||
.build(); | ||
|
||
// when | ||
List<Product> profileProducts = member.getProfileProducts(); | ||
|
||
// then | ||
assertThat(profileProducts) | ||
.containsOnly(selectedInventoryProduct.getProduct()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters