mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Refactor AppEngineConnection
AppEngineConnection can now connect to all services and not just the tools. The default is still the tools. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=218734983
This commit is contained in:
parent
97aa98eb35
commit
b48061b792
31 changed files with 269 additions and 329 deletions
|
@ -21,7 +21,6 @@ import static org.mockito.Mockito.verify;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.net.MediaType;
|
||||
import google.registry.tools.CommandWithConnection.Connection;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mock;
|
||||
|
@ -30,8 +29,7 @@ import org.mockito.Mock;
|
|||
public class CreateRegistrarGroupsCommandTest extends
|
||||
CommandTestCase<CreateRegistrarGroupsCommand> {
|
||||
|
||||
@Mock
|
||||
private Connection connection;
|
||||
@Mock private AppEngineConnection connection;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
|
@ -41,16 +39,18 @@ public class CreateRegistrarGroupsCommandTest extends
|
|||
@Test
|
||||
public void test_createGroupsForTwoRegistrars() throws Exception {
|
||||
runCommandForced("NewRegistrar", "TheRegistrar");
|
||||
verify(connection).send(
|
||||
eq("/_dr/admin/createGroups"),
|
||||
eq(ImmutableMap.of("clientId", "NewRegistrar")),
|
||||
eq(MediaType.PLAIN_TEXT_UTF_8),
|
||||
eq(new byte[0]));
|
||||
verify(connection).send(
|
||||
eq("/_dr/admin/createGroups"),
|
||||
eq(ImmutableMap.of("clientId", "TheRegistrar")),
|
||||
eq(MediaType.PLAIN_TEXT_UTF_8),
|
||||
eq(new byte[0]));
|
||||
verify(connection)
|
||||
.sendPostRequest(
|
||||
eq("/_dr/admin/createGroups"),
|
||||
eq(ImmutableMap.of("clientId", "NewRegistrar")),
|
||||
eq(MediaType.PLAIN_TEXT_UTF_8),
|
||||
eq(new byte[0]));
|
||||
verify(connection)
|
||||
.sendPostRequest(
|
||||
eq("/_dr/admin/createGroups"),
|
||||
eq(ImmutableMap.of("clientId", "TheRegistrar")),
|
||||
eq(MediaType.PLAIN_TEXT_UTF_8),
|
||||
eq(new byte[0]));
|
||||
assertInStdout("Success!");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue