mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Migrates users from the unitless, ambiguous plus(long) and minus(long) methods on various Joda-Time APIs to their Duration-accepting overloads.
This makes the units explicit, which prevents confusion and bugs. More information: [] Tested: TAP --sample for global presubmit queue [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=172455602
This commit is contained in:
parent
108deb7f9d
commit
6f9b039e72
4 changed files with 12 additions and 5 deletions
|
@ -154,7 +154,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
|
|
||||||
public DomainCreateFlowTest() {
|
public DomainCreateFlowTest() {
|
||||||
setEppInput("domain_create.xml");
|
setEppInput("domain_create.xml");
|
||||||
clock.setTo(DateTime.parse("1999-04-03T22:00:00.0Z").minus(1));
|
clock.setTo(DateTime.parse("1999-04-03T22:00:00.0Z").minus(Duration.millis(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class EppResourceUtilsTest {
|
||||||
newHostResource("ns1.cat.tld").asBuilder()
|
newHostResource("ns1.cat.tld").asBuilder()
|
||||||
.setCreationTimeForTest(clock.nowUtc())
|
.setCreationTimeForTest(clock.nowUtc())
|
||||||
.build());
|
.build());
|
||||||
assertThat(loadAtPointInTime(host, clock.nowUtc().minus(1)).now()).isNull();
|
assertThat(loadAtPointInTime(host, clock.nowUtc().minus(Duration.millis(1))).now()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.io.PrintStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.Duration;
|
||||||
import org.joda.time.Interval;
|
import org.joda.time.Interval;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -333,7 +334,9 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
"Don't pass both --initial_tld_state and --tld_state_transitions");
|
"Don't pass both --initial_tld_state and --tld_state_transitions");
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
String.format("--tld_state_transitions=%s=PREDELEGATION,%s=SUNRISE", now, now.plus(1)),
|
String.format(
|
||||||
|
"--tld_state_transitions=%s=PREDELEGATION,%s=SUNRISE",
|
||||||
|
now, now.plus(Duration.millis(1))),
|
||||||
"--initial_tld_state=GENERAL_AVAILABILITY",
|
"--initial_tld_state=GENERAL_AVAILABILITY",
|
||||||
"--dns_writers=VoidDnsWriter",
|
"--dns_writers=VoidDnsWriter",
|
||||||
"xn--q9jyb4c");
|
"xn--q9jyb4c");
|
||||||
|
|
|
@ -530,7 +530,9 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||||
thrown.expect(
|
thrown.expect(
|
||||||
ParameterException.class, "not formatted correctly or has transition times out of order");
|
ParameterException.class, "not formatted correctly or has transition times out of order");
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
String.format("--tld_state_transitions=%s=PREDELEGATION,%s=SUNRISE", now, now.minus(1)),
|
String.format(
|
||||||
|
"--tld_state_transitions=%s=PREDELEGATION,%s=SUNRISE",
|
||||||
|
now, now.minus(Duration.millis(1))),
|
||||||
"xn--q9jyb4c");
|
"xn--q9jyb4c");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,7 +632,9 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||||
thrown.expect(
|
thrown.expect(
|
||||||
ParameterException.class, "not formatted correctly or has transition times out of order");
|
ParameterException.class, "not formatted correctly or has transition times out of order");
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
String.format("--renew_billing_cost_transitions=\"%s=USD 1,%s=USD 2\"", now, now.minus(1)),
|
String.format(
|
||||||
|
"--renew_billing_cost_transitions=\"%s=USD 1,%s=USD 2\"",
|
||||||
|
now, now.minus(Duration.millis(1))),
|
||||||
"xn--q9jyb4c");
|
"xn--q9jyb4c");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue