Migrate away from VoidWorks

This is one last hanging piece of work left over from last year's Java 8
migration. There's no functionality changes in this CL, just refactoring.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201947600
This commit is contained in:
mcilwain
2018-06-27 15:28:52 -04:00
committed by Ben McIlwain
parent 7d3cb3d426
commit d3364b0387
18 changed files with 349 additions and 502 deletions
@@ -35,7 +35,6 @@ import com.google.appengine.api.taskqueue.TransientFailureException;
import com.google.apphosting.api.DeadlineExceededException;
import com.google.common.collect.ImmutableList;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.VoidWork;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.ofy.Ofy;
@@ -174,15 +173,7 @@ public class LordnTaskTest {
public void test_enqueueDomainResourceTask_throwsNpeOnNullDomain() {
assertThrows(
NullPointerException.class,
() ->
ofy()
.transactNew(
new VoidWork() {
@Override
public void vrun() {
LordnTask.enqueueDomainResourceTask(null);
}
}));
() -> ofy().transactNew(() -> LordnTask.enqueueDomainResourceTask(null)));
}
@SuppressWarnings("unchecked")