mirror of
https://github.com/google/nomulus.git
synced 2025-07-04 18:23:26 +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
|
@ -28,7 +28,6 @@ import com.google.common.base.Splitter;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.net.MediaType;
|
||||
import google.registry.tools.CommandWithConnection.Connection;
|
||||
import google.registry.tools.server.ToolsTestData;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Map;
|
||||
|
@ -49,7 +48,7 @@ import org.mockito.ArgumentCaptor;
|
|||
*/
|
||||
public class EppToolVerifier {
|
||||
|
||||
private final Connection connection = mock(Connection.class);
|
||||
private final AppEngineConnection connection = mock(AppEngineConnection.class);
|
||||
|
||||
private String clientId;
|
||||
private boolean superuser;
|
||||
|
@ -167,11 +166,9 @@ public class EppToolVerifier {
|
|||
return;
|
||||
}
|
||||
ArgumentCaptor<byte[]> params = ArgumentCaptor.forClass(byte[].class);
|
||||
verify(connection, atLeast(0)).send(
|
||||
eq("/_dr/epptool"),
|
||||
eq(ImmutableMap.of()),
|
||||
eq(MediaType.FORM_DATA),
|
||||
params.capture());
|
||||
verify(connection, atLeast(0))
|
||||
.sendPostRequest(
|
||||
eq("/_dr/epptool"), eq(ImmutableMap.of()), eq(MediaType.FORM_DATA), params.capture());
|
||||
capturedParams = ImmutableList.copyOf(params.getAllValues());
|
||||
paramIndex = 0;
|
||||
}
|
||||
|
@ -198,7 +195,7 @@ public class EppToolVerifier {
|
|||
}
|
||||
|
||||
/** Returns the (mock) Connection that is being monitored by this verifier. */
|
||||
private Connection getConnection() {
|
||||
private AppEngineConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue