Skip to content

Commit

Permalink
test: Product Validator 에 단위 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
koo995 committed Jul 29, 2024
1 parent e08b3ea commit a345677
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ void validate() throws Exception {
Assertions.assertThrows(ProductDuplicatedException.class, () -> {
productValidator.validate(product2);
});

}
@DisplayName("서로 다른 상품이 등록되면 정상처리된다..")
@Test
void validate2() throws Exception {
// given
Product product = Product.builder()
.productName("촉촉한 초코칩 쿠키")
.productCorp(" 오리온")
.build();
productRepository.save(product);

// when
Product product2 = Product.builder()
.productName("쵹촉한초코칩쿠키")
.productCorp("오리온")
.build();

// then
Assertions.assertDoesNotThrow(() -> {
productValidator.validate(product2);
});
}
}

0 comments on commit a345677

Please sign in to comment.