mirror of
https://github.com/google/nomulus.git
synced 2025-07-07 03:33:28 +02: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:
parent
8dbfbb0f33
commit
8fe9cde9ff
14 changed files with 58 additions and 64 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue