Beispiel #1
0
  @Test
  public void basics() {
    BaseEntity another = new BaseEntity();
    assertNull("id is set.", another.getId());
    assertNull("version is set.", another.getVersion());

    another.setId(ID);
    assertNotNull("id is null.", another.getId());
    another.setId(null);
    assertNull("id not cleared.", another.getId());

    another.setVersion(VERSION);
    assertNotNull("version is null.", another.getVersion());
    another.setVersion(null);
    assertNull("version not cleared.", another.getVersion());
  }
Beispiel #2
0
 @Test
 public void copyConstructor() {
   BaseEntity another = new BaseEntity(entity);
   assertEquals("id not same.", entity.getId(), another.getId());
   assertEquals("version not same.", entity.getVersion(), another.getVersion());
 }