@Test public void shouldCreateACreditCard() throws Exception { CreditCard creditCard = new CreditCard("123412341234", "12/12", 1253, CreditCardType.AMERICAN_EXPRESS); tx.begin(); em.persist(creditCard); tx.commit(); assertNotNull(creditCard.getNumber(), "Id should not be null"); }
public String getNumber() { return number; }
CreditCard { public String getNumber() { return number; } }
CreditCard { public String getNumber() { return number; } CreditCard();  CreditCard(String number, String expiryDate, Integer controlNumber, CreditCardType creditCardType); }
CreditCard { public String getNumber() { return number; } CreditCard();  CreditCard(String number, String expiryDate, Integer controlNumber, CreditCardType creditCardType); String getNumber(); void setNumber(String number); String getExpiryDate(); void setExpiryDate(String expiryDate); Integer getControlNumber(); void setControlNumber(Integer controlNumber); CreditCardType getType(); void setType(CreditCardType creditCardType); }
CreditCard { public String getNumber() { return number; } CreditCard();  CreditCard(String number, String expiryDate, Integer controlNumber, CreditCardType creditCardType); String getNumber(); void setNumber(String number); String getExpiryDate(); void setExpiryDate(String expiryDate); Integer getControlNumber(); void setControlNumber(Integer controlNumber); CreditCardType getType(); void setType(CreditCardType creditCardType);  }