Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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