mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 17:01:51 +02:00
Turn CheckApiAction into a standard-ish epp endpoint
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125335634
This commit is contained in:
parent
bb82f5bc05
commit
2b2fb958f6
15 changed files with 76 additions and 182 deletions
|
@ -33,6 +33,7 @@ java_library(
|
|||
"//third_party/java/appengine:appengine-testing",
|
||||
"//third_party/java/joda_money",
|
||||
"//third_party/java/joda_time",
|
||||
"//third_party/java/json_simple",
|
||||
"//third_party/java/jsr305_annotations",
|
||||
"//third_party/java/junit",
|
||||
"//third_party/java/mockito",
|
||||
|
@ -48,8 +49,6 @@ java_library(
|
|||
"//java/google/registry/monitoring/whitebox",
|
||||
"//java/google/registry/pricing",
|
||||
"//java/google/registry/request",
|
||||
"//java/google/registry/security",
|
||||
"//java/google/registry/security:servlets",
|
||||
"//java/google/registry/tmch",
|
||||
"//java/google/registry/util",
|
||||
"//java/google/registry/xml",
|
||||
|
|
|
@ -12,18 +12,21 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.ui.server.api;
|
||||
package google.registry.flows;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import google.registry.config.RegistryEnvironment;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.monitoring.whitebox.EppMetrics;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.util.SystemClock;
|
||||
|
@ -62,7 +65,10 @@ public class CheckApiActionTest {
|
|||
private Map<String, Object> getCheckResponse(String domain) {
|
||||
action.domain = domain;
|
||||
action.response = new FakeResponse();
|
||||
action.clock = new SystemClock();
|
||||
action.config = RegistryEnvironment.UNITTEST.config();
|
||||
action.eppController = new EppController();
|
||||
action.eppController.clock = new SystemClock();
|
||||
action.eppController.metrics = mock(EppMetrics.class);
|
||||
action.run();
|
||||
return (Map<String, Object>) JSONValue.parse(((FakeResponse) action.response).getPayload());
|
||||
}
|
|
@ -54,10 +54,8 @@ java_library(
|
|||
"//java/com/google/common/net",
|
||||
"//third_party/java/jsr305_annotations",
|
||||
"//third_party/java/servlet/servlet_api",
|
||||
"//java/google/registry/flows",
|
||||
"//java/google/registry/module/backend",
|
||||
"//java/google/registry/module/frontend",
|
||||
"//java/google/registry/ui/server/api",
|
||||
"//java/google/registry/ui/server/registrar",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package(
|
||||
default_testonly = 1,
|
||||
default_visibility = ["//java/google/registry:registry_project"],
|
||||
)
|
||||
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
||||
load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules")
|
||||
|
||||
|
||||
java_library(
|
||||
name = "api",
|
||||
srcs = glob(["*.java"]),
|
||||
deps = [
|
||||
"//java/com/google/common/collect",
|
||||
"//third_party/java/appengine:appengine-api-testonly",
|
||||
"//third_party/java/json_simple",
|
||||
"//third_party/java/junit",
|
||||
"//third_party/java/mockito",
|
||||
"//third_party/java/servlet/servlet_api",
|
||||
"//third_party/java/truth",
|
||||
"//java/google/registry/model",
|
||||
"//java/google/registry/ui/server/api",
|
||||
"//java/google/registry/util",
|
||||
"//javatests/google/registry/testing",
|
||||
],
|
||||
)
|
||||
|
||||
GenTestRules(
|
||||
name = "GeneratedTestRules",
|
||||
test_files = glob(["*Test.java"]),
|
||||
deps = [":api"],
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue