### Question:
ParseTimestamp extends AbstractGeoGigOp<Long> { public ParseTimestamp setString(String string) { this.string = string; return this; }  ParseTimestamp setString(String string);  }### Answer:
@Test public void testWrongString() { command.setString("awrongstring"); Exception e = assertThrows(IllegalArgumentException.class, command::call); assertThat(e.getMessage(), containsString("Invalid timestamp string: awrongstring")); command.setString("a wrong string"); e = assertThrows(IllegalArgumentException.class, command::call); assertThat(e.getMessage(), containsString("Invalid timestamp string: a wrong string")); }
@Test public void testWrongString() { command.setString("awrongstring"); exception.expect(IllegalArgumentException.class); exception.expectMessage("Invalid timestamp string: awrongstring"); command.call(); command.setString("a wrong string"); exception.expect(IllegalArgumentException.class); exception.expectMessage("Invalid timestamp string: a wrong string"); command.call(); }
@Test public void testGitLikeStrings() throws ParseException { Date today = format.parse("1972-10-10 00:00:00"); Date yesterday = format.parse("1972-10-09 00:00:00"); Date aMinuteAgo = format.parse("1972-10-10 10:09:10"); Date tenMinutesAgo = format.parse("1972-10-10 10:00:10"); Date tenHoursTenMinutesAgo = format.parse("1972-10-10 00:00:10"); Date aWeekAgo = format.parse("1972-10-03 10:10:10"); Date actual; actual = new Date(command.setString("today").call()); assertEquals(today, actual); actual = new Date(command.setString("yesterday").call()); assertEquals(yesterday, actual); actual = new Date(command.setString("1.minute.ago").call()); assertEquals(aMinuteAgo, actual); actual = new Date(command.setString("10.minutes.ago").call()); assertEquals(tenMinutesAgo, actual); actual = new Date(command.setString("10.MINUTES.AGO").call()); assertEquals(tenMinutesAgo, actual); actual = new Date(command.setString("10.hours.10.minutes.ago").call()); assertEquals(tenHoursTenMinutesAgo, actual); actual = new Date(command.setString("1.week.ago").call()); assertEquals(aWeekAgo, actual); }