Exemple #1
0
 @Test
 public void testPreUpdate() {
   spyStock.preUpdate();
   verify(spyStock, times(1)).preUpdate();
 }
Exemple #2
0
 @Test
 public void testStockIsNotDetached() {
   spyStock.setId(0L);
   assertFalse("Detached", spyStock.isDetached());
   verify(spyStock, times(1)).isDetached();
 }
Exemple #3
0
 @Test
 public void testPrePersist() {
   spyStock.prePersist();
   verify(spyStock, times(1)).prePersist();
 }
Exemple #4
0
 @Test
 public void testGetQuantity() {
   assertNull("Quantity", spyStock.getQuantity());
   verify(spyStock, times(1)).getQuantity();
 }
Exemple #5
0
 @Test
 public void testStockIsDetached() {
   spyStock.setId(1L);
   assertTrue("Detached", spyStock.isDetached());
   verify(spyStock, times(1)).isDetached();
 }
Exemple #6
0
 @Test
 public void testGetProduct() {
   assertNotNull("Product", spyStock.getProduct());
   verify(spyStock, times(1)).getProduct();
 }
Exemple #7
0
 @Before
 public void setUp() throws Exception {
   mockProduct = mock(Product.class);
   spyStock = spy(Stock.class);
   spyStock.setProduct(mockProduct);
 }
Exemple #8
0
 @Test
 public void testToString() {
   assertEquals(
       ToStringBuilder.reflectionToString(spyStock, SHORT_PREFIX_STYLE), spyStock.toString());
 }
Exemple #9
0
 @Test
 public void testSetQuantity() {
   spyStock.setQuantity(BigInteger.ZERO);
   assertEquals("Quantity", BigInteger.ZERO, spyStock.getQuantity());
   verify(spyStock, times(1)).setQuantity(any());
 }
Exemple #10
0
 @Test
 public void testSetProduct() {
   spyStock.setProduct(null);
   assertNull("Product", spyStock.getProduct());
   verify(spyStock, times(1)).setProduct(null);
 }