-
-
Save jasongorman/d27bfe5d1fb6d6092e8c1f845e152420 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
public class StockMonitorTest { | |
@Test | |
public void alertSentWhenProductNeedsReordering() { | |
Alert alert = mock(Alert.class); | |
ReorderLevel reorderLevel = product1 -> 10; | |
Product product = new Product(811, 11, 14); | |
Warehouse warehouse = productId -> product; | |
StockMonitor monitor = new StockMonitor(alert, warehouse, reorderLevel); | |
monitor.productSold(811, 1); | |
verify(alert).send(product); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment