Remove transition code from []

The parameters were optional during the transition to allow old jobs stuck in the queue to work properly. It's been 2 months now so it's time to end the transition.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190235532
This commit is contained in:
guyben 2018-03-23 10:10:00 -07:00 committed by jianglai
parent 785225fc28
commit 89d8ba93f2
5 changed files with 29 additions and 34 deletions

View file

@ -42,7 +42,6 @@ import google.registry.testing.AppEngineRule;
import google.registry.testing.FakeClock;
import google.registry.testing.FakeLockHandler;
import google.registry.testing.InjectRule;
import java.util.Optional;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.junit.Before;
@ -93,8 +92,8 @@ public class PublishDnsUpdatesActionTest {
action.tld = tld;
action.hosts = ImmutableSet.of();
action.domains = ImmutableSet.of();
action.itemsCreateTime = Optional.of(clock.nowUtc().minusHours(2));
action.enqueuedTime = Optional.of(clock.nowUtc().minusHours(1));
action.itemsCreateTime = clock.nowUtc().minusHours(2);
action.enqueuedTime = clock.nowUtc().minusHours(1);
action.dnsWriter = "correctWriter";
action.dnsWriterProxy = new DnsWriterProxy(ImmutableMap.of("correctWriter", dnsWriter));
action.dnsMetrics = dnsMetrics;

View file

@ -67,6 +67,8 @@ public class ReadDnsQueueActionTest {
private static final int TEST_TLD_UPDATE_BATCH_SIZE = 100;
private DnsQueue dnsQueue;
// Because of a bug in the queue test environment - b/73372999 - we must set the fake date of the
// test in the future. Set to year 3000 so it'll remain in the future for a very long time.
private FakeClock clock = new FakeClock(DateTime.parse("3000-01-01TZ"));
@Rule
@ -129,10 +131,11 @@ public class ReadDnsQueueActionTest {
}
private static TaskOptions createRefreshTask(String name, TargetType type) {
TaskOptions options = TaskOptions.Builder
.withMethod(Method.PULL)
.param(DNS_TARGET_TYPE_PARAM, type.toString())
.param(DNS_TARGET_NAME_PARAM, name);
TaskOptions options =
TaskOptions.Builder.withMethod(Method.PULL)
.param(DNS_TARGET_TYPE_PARAM, type.toString())
.param(DNS_TARGET_NAME_PARAM, name)
.param(DNS_TARGET_CREATE_TIME_PARAM, "3000-01-01TZ");
String tld = InternetDomainName.from(name).parts().reverse().get(0);
return options.param("tld", tld);
}
@ -285,6 +288,7 @@ public class ReadDnsQueueActionTest {
.method(Method.PULL)
.param(DNS_TARGET_TYPE_PARAM, TargetType.DOMAIN.toString())
.param(DNS_TARGET_NAME_PARAM, "domain.unknown")
.param(DNS_TARGET_CREATE_TIME_PARAM, "3000-01-01TZ")
.param(PARAM_TLD, "unknown"));
run();