Пример #1
0
 @Before
 public void setUp() throws Exception {
   mockProduct = mock(Product.class);
   spyStock = spy(Stock.class);
   spyStock.setProduct(mockProduct);
 }
Пример #2
0
 @Test
 public void testSetProduct() {
   spyStock.setProduct(null);
   assertNull("Product", spyStock.getProduct());
   verify(spyStock, times(1)).setProduct(null);
 }