ArgsToVote { public static Vote parse(String[] arguments) { return parse(arguments, null); }  static Vote parse(String[] arguments); static Vote parse(String[] arguments, Map<String, String> additionalArgs);  }
@Test void handlesInvalidRequest() { assertThrows(IllegalArgumentException.class, () -> { ArgsToVote.parse(new String[0]); }); }
@Test void handlesSingleUsername() { Vote vote = ArgsToVote.parse(new String[] { "dummy_user" }); assertEquals("dummy_user", vote.getUsername()); }
@Test void handlesSingleUsernameTooLong() { assertThrows(IllegalArgumentException.class, () -> { ArgsToVote.parse(new String[] { "AVeryVeryVeryLongUsername" }); }); }
@Test void handlesUsernameKeywordArgument() { Vote vote = ArgsToVote.parse(new String[] { "username=dummy_user" }); assertEquals("dummy_user", vote.getUsername()); }