Refactor move tests from ebean-core to ebean-test

This commit is contained in:
rbygrave
2021-09-08 22:49:23 +12:00
parent 0b00a14fd3
commit eab56d323b
1650 changed files with 185 additions and 147 deletions
@@ -0,0 +1,33 @@
package org.tests.idkeys;
import io.avaje.moduuid.ModUUID;
import io.ebean.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.ECustomId;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class TestCustomId extends BaseTestCase {
@Test
public void insert() {
ECustomId bean = new ECustomId("fred");
DB.save(bean);
assertNotNull(bean.getId());
}
@Test
public void insert_when_hasValue() {
ECustomId bean = new ECustomId("gotId");
String explicitId = ModUUID.newShortId();
bean.setId(explicitId);
DB.save(bean);
ECustomId found = DB.find(ECustomId.class, explicitId);
assertEquals(found.getName(), bean.getName());
}
}