mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Run automatic Java 8 conversion over codebase
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171174380
This commit is contained in:
parent
44df5da771
commit
5edb7935ed
190 changed files with 2312 additions and 3096 deletions
|
@ -26,9 +26,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions;
|
||||
import static google.registry.util.DatastoreServiceUtils.KEY_TO_KIND_FUNCTION;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -56,7 +54,6 @@ import google.registry.model.registry.Registry.TldState;
|
|||
import google.registry.model.smd.EncodedSignedMark;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.EppLoader;
|
||||
import java.util.List;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -336,20 +333,20 @@ public class DomainApplicationInfoFlowTest
|
|||
int numPreviousReads = RequestCapturingAsyncDatastoreService.getReads().size();
|
||||
doSuccessfulTest("domain_info_sunrise_response.xml", HostsState.HOSTS_EXIST);
|
||||
// Get all of the keys loaded in the flow, with each distinct load() call as a list of keys.
|
||||
int numReadsWithContactsOrHosts = FluentIterable
|
||||
.from(RequestCapturingAsyncDatastoreService.getReads())
|
||||
.skip(numPreviousReads)
|
||||
.filter(
|
||||
new Predicate<List<com.google.appengine.api.datastore.Key>>() {
|
||||
@Override
|
||||
public boolean apply(List<com.google.appengine.api.datastore.Key> keys) {
|
||||
return FluentIterable.from(keys)
|
||||
.transform(KEY_TO_KIND_FUNCTION)
|
||||
.anyMatch(Predicates.or(
|
||||
equalTo(Key.getKind(ContactResource.class)),
|
||||
equalTo(Key.getKind(HostResource.class))));
|
||||
}})
|
||||
.size();
|
||||
int numReadsWithContactsOrHosts =
|
||||
(int)
|
||||
RequestCapturingAsyncDatastoreService.getReads()
|
||||
.stream()
|
||||
.skip(numPreviousReads)
|
||||
.filter(
|
||||
keys ->
|
||||
keys.stream()
|
||||
.map(KEY_TO_KIND_FUNCTION)
|
||||
.anyMatch(
|
||||
Predicates.or(
|
||||
equalTo(Key.getKind(ContactResource.class)),
|
||||
equalTo(Key.getKind(HostResource.class)))))
|
||||
.count();
|
||||
assertThat(numReadsWithContactsOrHosts).isEqualTo(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue