mirror of
https://github.com/google/nomulus
synced 2026-09-01 21:57:02 +00:00
Add some missing @Nullables and types (#753)
* Add some missing @Nullables and types Also deletes two unused VKey.createOfy() methods that simply don't work, because a kind and an id is not enough to create a Datastore key; you also need the full entity group inheritance chain for entities that are not roots themselves (which is most of the entities in our schema). * Merge branch 'master' into add-missing-nullables * Throw UnsupportedOperationException for contacts/hosts too * Merge branch 'master' into add-missing-nullables
This commit is contained in:
@@ -51,7 +51,7 @@ public class RegistrarDaoTest {
|
||||
private Registrar testRegistrar;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
testRegistrar =
|
||||
new Registrar.Builder()
|
||||
.setType(Registrar.Type.TEST)
|
||||
@@ -69,14 +69,14 @@ public class RegistrarDaoTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void saveNew_worksSuccessfully() {
|
||||
void saveNew_worksSuccessfully() {
|
||||
assertThat(jpaTm().transact(() -> jpaTm().checkExists(testRegistrar))).isFalse();
|
||||
jpaTm().transact(() -> jpaTm().saveNew(testRegistrar));
|
||||
assertThat(jpaTm().transact(() -> jpaTm().checkExists(testRegistrar))).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void update_worksSuccessfully() {
|
||||
void update_worksSuccessfully() {
|
||||
jpaTm().transact(() -> jpaTm().saveNew(testRegistrar));
|
||||
Registrar persisted = jpaTm().transact(() -> jpaTm().load(registrarKey));
|
||||
assertThat(persisted.getRegistrarName()).isEqualTo("registrarName");
|
||||
@@ -91,7 +91,7 @@ public class RegistrarDaoTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void update_throwsExceptionWhenEntityDoesNotExist() {
|
||||
void update_throwsExceptionWhenEntityDoesNotExist() {
|
||||
assertThat(jpaTm().transact(() -> jpaTm().checkExists(testRegistrar))).isFalse();
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
@@ -99,7 +99,7 @@ public class RegistrarDaoTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void load_worksSuccessfully() {
|
||||
void load_worksSuccessfully() {
|
||||
assertThat(jpaTm().transact(() -> jpaTm().checkExists(testRegistrar))).isFalse();
|
||||
jpaTm().transact(() -> jpaTm().saveNew(testRegistrar));
|
||||
Registrar persisted = jpaTm().transact(() -> jpaTm().load(registrarKey));
|
||||
|
||||
Reference in New Issue
Block a user