Remove leniency on poll message ID format without years in them

It's been long enough since the format change adding in years that all
registrars should no longer have any IDs in the old format lying around
that they're still attempting to ACK. All poll messages have already been
coming back to registrars with the new format for months now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184714735
This commit is contained in:
mcilwain 2018-02-06 11:44:50 -08:00 committed by jianglai
parent 6280d74f1c
commit 29c38f3622
5 changed files with 40 additions and 42 deletions

View file

@ -122,19 +122,10 @@ public class PollMessageExternalKeyConverterTest {
}
@Test
// TODO(b/68953444): Remove leniency when backwards compatibility with missing field is no longer
// required.
public void testSuccess_stillParsesWithMissingYearField() {
PollMessage.OneTime pollMessage =
persistResource(
new PollMessage.OneTime.Builder()
.setClientId("TheRegistrar")
.setEventTime(clock.nowUtc())
.setMsg("Test poll message")
.setParent(historyEntry)
.build());
assertThat(makePollMessageExternalId(pollMessage)).isEqualTo("1-2-FOOBAR-4-5-2007");
assertThat(parsePollMessageExternalId("1-2-FOOBAR-4-5")).isEqualTo(Key.create(pollMessage));
public void testFailure_missingYearField() {
assertThrows(
PollMessageExternalKeyParseException.class,
() -> parsePollMessageExternalId("1-2-FOOBAR-4-5"));
}
@Test