mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
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:
parent
b733443eab
commit
d4f222cecd
1 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue