Created
June 29, 2022 13:27
-
-
Save atesibrahim/61c44c44e83ac56dcb5c126448f298e1 to your computer and use it in GitHub Desktop.
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
@Test | |
public void it_should_save_number_when_flag_is_true() { | |
//Given | |
ArgumentCaptor<Product> productArgumentCaptor = ArgumentCaptor.forClass(Product.class); | |
Product product = Product.builder().isFlag(true).build(); | |
//When | |
productService.save(product); | |
//Then | |
verify(productRepository).save(productArgumentCaptor.capture()); | |
final Product capturedProduct = productArgumentCaptor.getValue(); | |
assertThat(capturedProduct.getIsFlag()).isTrue(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment