Fix RestoreCommitLogsCommandTest in kokoro

Convert RestoreCommitLogsCommandTest use of generics and mockito to a form
that works with the kokoro build:

- Replace ImmutableMap<String, Object> with ImmutableMap<String, ?>.
- Replace any() as a matcher for MediaType with an "eq()" matcher.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157148910
This commit is contained in:
mmuller 2017-05-25 13:54:14 -07:00 committed by Ben McIlwain
parent b733443eab
commit d4f222cecd

View file

@ -15,11 +15,11 @@
package google.registry.tools; package google.registry.tools;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq; import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.net.MediaType;
import google.registry.backup.RestoreCommitLogsAction; import google.registry.backup.RestoreCommitLogsAction;
import google.registry.tools.ServerSideCommand.Connection; import google.registry.tools.ServerSideCommand.Connection;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -69,9 +69,13 @@ public class RestoreCommitLogsCommandTest extends CommandTestCase<RestoreCommitL
// Note that this is very similar to the one in CreateOrUpdatePremiumListCommandTestCase.java but // Note that this is very similar to the one in CreateOrUpdatePremiumListCommandTestCase.java but
// not identical. // not identical.
void verifySend(ImmutableMap<String, Object> parameters) throws Exception { void verifySend(ImmutableMap<String, ?> parameters) throws Exception {
verify(connection) verify(connection)
.send(eq(RestoreCommitLogsAction.PATH), urlParamCaptor.capture(), any(), eq(new byte[0])); .send(
eq(RestoreCommitLogsAction.PATH),
urlParamCaptor.capture(),
eq(MediaType.PLAIN_TEXT_UTF_8),
eq(new byte[0]));
assertThat(urlParamCaptor.getValue()).containsExactlyEntriesIn(parameters); assertThat(urlParamCaptor.getValue()).containsExactlyEntriesIn(parameters);
} }
} }