From d4f222cecdc965ad7635fe8162ae674e76e3d2e7 Mon Sep 17 00:00:00 2001 From: mmuller Date: Thu, 25 May 2017 13:54:14 -0700 Subject: [PATCH] Fix RestoreCommitLogsCommandTest in kokoro Convert RestoreCommitLogsCommandTest use of generics and mockito to a form that works with the kokoro build: - Replace ImmutableMap with ImmutableMap. - Replace any() as a matcher for MediaType with an "eq()" matcher. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=157148910 --- .../registry/tools/RestoreCommitLogsCommandTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/javatests/google/registry/tools/RestoreCommitLogsCommandTest.java b/javatests/google/registry/tools/RestoreCommitLogsCommandTest.java index b9d8ca5c8..dac5a8ffd 100644 --- a/javatests/google/registry/tools/RestoreCommitLogsCommandTest.java +++ b/javatests/google/registry/tools/RestoreCommitLogsCommandTest.java @@ -15,11 +15,11 @@ package google.registry.tools; import static com.google.common.truth.Truth.assertThat; -import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.verify; import com.google.common.collect.ImmutableMap; +import com.google.common.net.MediaType; import google.registry.backup.RestoreCommitLogsAction; import google.registry.tools.ServerSideCommand.Connection; import org.joda.time.DateTime; @@ -69,9 +69,13 @@ public class RestoreCommitLogsCommandTest extends CommandTestCase parameters) throws Exception { + void verifySend(ImmutableMap parameters) throws Exception { 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); } }