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