mirror of
https://github.com/google/nomulus
synced 2026-09-29 03:05:42 +00:00
Wire in MetricReporter into the backend servlet to publish metrics
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130468842
This commit is contained in:
@@ -20,6 +20,7 @@ java_library(
|
||||
"//third_party/java/servlet/servlet_api",
|
||||
"//third_party/java/truth",
|
||||
"//java/google/registry/module/backend",
|
||||
"//javatests/google/registry/testing",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -18,8 +18,10 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
@@ -28,6 +30,10 @@ import org.junit.runners.JUnit4;
|
||||
@RunWith(JUnit4.class)
|
||||
public class BackendServletTest {
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine =
|
||||
AppEngineRule.builder().withDatastore().withLocalModules().build();
|
||||
|
||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||
|
||||
|
||||
@@ -269,10 +269,9 @@ public final class AppEngineRule extends ExternalResource {
|
||||
}
|
||||
if (withLocalModules) {
|
||||
configs.add(new LocalModulesServiceTestConfig()
|
||||
.addDefaultModuleVersion()
|
||||
.addAutomaticScalingModuleVersion("default", "v1")
|
||||
.addAutomaticScalingModuleVersion("tools", "v1")
|
||||
.addAutomaticScalingModuleVersion("backend", "v1"));
|
||||
.addBasicScalingModuleVersion("default", "1", 1)
|
||||
.addBasicScalingModuleVersion("tools", "1", 1)
|
||||
.addBasicScalingModuleVersion("backend", "1", 1));
|
||||
}
|
||||
if (withTaskQueue) {
|
||||
File queueFile = temporaryFolder.newFile("queue.xml");
|
||||
@@ -307,6 +306,10 @@ public final class AppEngineRule extends ExternalResource {
|
||||
});
|
||||
}
|
||||
|
||||
if (withLocalModules) {
|
||||
helper.setEnvInstance("0");
|
||||
}
|
||||
|
||||
helper.setUp();
|
||||
|
||||
if (withDatastore) {
|
||||
|
||||
Reference in New Issue
Block a user