Daggerize ExportSnapshotServlet and CheckSnapshotServlet

Eradicate the last remnants of un-injectable servlets!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145598002
This commit is contained in:
jianglai 2017-01-25 14:36:42 -08:00 committed by Ben McIlwain
parent a8aeff96f6
commit 4fed3a9ae6
15 changed files with 577 additions and 642 deletions

View file

@ -0,0 +1,226 @@
// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.export;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.export.CheckSnapshotAction.CHECK_SNAPSHOT_KINDS_TO_LOAD_PARAM;
import static google.registry.export.CheckSnapshotAction.CHECK_SNAPSHOT_NAME_PARAM;
import static google.registry.testing.TaskQueueHelper.assertNoTasksEnqueued;
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
import static org.mockito.Mockito.when;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.request.Action.Method;
import google.registry.request.HttpException.BadRequestException;
import google.registry.request.HttpException.NoContentException;
import google.registry.request.HttpException.NotModifiedException;
import google.registry.testing.AppEngineRule;
import google.registry.testing.ExceptionRule;
import google.registry.testing.FakeClock;
import google.registry.testing.FakeResponse;
import google.registry.testing.InjectRule;
import google.registry.testing.TaskQueueHelper.TaskMatcher;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/** Unit tests for {@link CheckSnapshotAction}. */
@RunWith(MockitoJUnitRunner.class)
public class CheckSnapshotActionTest {
static final DateTime START_TIME = DateTime.parse("2014-08-01T01:02:03Z");
static final DateTime COMPLETE_TIME = START_TIME.plus(Duration.standardMinutes(30));
@Rule public final InjectRule inject = new InjectRule();
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withTaskQueue().build();
@Rule public final ExceptionRule thrown = new ExceptionRule();
@Mock private DatastoreBackupService backupService;
private DatastoreBackupInfo backupInfo;
private final FakeResponse response = new FakeResponse();
private final FakeClock clock = new FakeClock(COMPLETE_TIME.plusMillis(1000));
private final CheckSnapshotAction action = new CheckSnapshotAction();
@Before
public void before() throws Exception {
inject.setStaticField(DatastoreBackupInfo.class, "clock", clock);
action.requestMethod = Method.POST;
action.snapshotName = "some_backup";
action.kindsToLoadParam = "one,two";
action.response = response;
action.backupService = backupService;
backupInfo =
new DatastoreBackupInfo(
"some_backup",
START_TIME,
Optional.of(COMPLETE_TIME),
ImmutableSet.of("one", "two", "three"),
Optional.of("gs://somebucket/some_backup_20140801.backup_info"));
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
}
private void setPendingBackup() {
backupInfo =
new DatastoreBackupInfo(
backupInfo.getName(),
backupInfo.getStartTime(),
Optional.<DateTime>absent(),
backupInfo.getKinds(),
backupInfo.getGcsFilename());
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
}
private static void assertLoadTaskEnqueued(String id, String file, String kinds)
throws Exception {
assertTasksEnqueued(
"export-snapshot",
new TaskMatcher()
.url("/_dr/task/loadSnapshot")
.method("POST")
.param("id", id)
.param("file", file)
.param("kinds", kinds));
}
@Test
public void testSuccess_enqueuePollTask() throws Exception {
CheckSnapshotAction.enqueuePollTask(
"some_snapshot_name", ImmutableSet.of("one", "two", "three"));
assertTasksEnqueued(
CheckSnapshotAction.QUEUE,
new TaskMatcher()
.url(CheckSnapshotAction.PATH)
.param(CHECK_SNAPSHOT_NAME_PARAM, "some_snapshot_name")
.param(CHECK_SNAPSHOT_KINDS_TO_LOAD_PARAM, "one,two,three")
.method("POST"));
}
@Test
public void testPost_forPendingBackup_returnsNotModified() throws Exception {
setPendingBackup();
thrown.expect(NotModifiedException.class, "Datastore backup some_backup still pending");
action.run();
}
@Test
public void testPost_forStalePendingBackupBackup_returnsNoContent() throws Exception {
setPendingBackup();
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
clock.setTo(
START_TIME
.plus(Duration.standardHours(20))
.plus(Duration.standardMinutes(3))
.plus(Duration.millis(1234)));
thrown.expect(
NoContentException.class,
"Datastore backup some_backup abandoned - "
+ "not complete after 20 hours, 3 minutes and 1 second");
action.run();
}
@Test
public void testPost_forCompleteBackup_enqueuesLoadTask() throws Exception {
action.run();
assertLoadTaskEnqueued(
"20140801_010203", "gs://somebucket/some_backup_20140801.backup_info", "one,two");
}
@Test
public void testPost_forCompleteAutoBackup_enqueuesLoadTask_usingBackupName() throws Exception {
action.snapshotName = "auto_snapshot_somestring";
when(backupService.findByName("auto_snapshot_somestring")).thenReturn(backupInfo);
action.run();
assertLoadTaskEnqueued(
"somestring", "gs://somebucket/some_backup_20140801.backup_info", "one,two");
}
@Test
public void testPost_forCompleteBackup_withExtraKindsToLoad_enqueuesLoadTask() throws Exception {
action.kindsToLoadParam = "one,foo";
action.run();
assertLoadTaskEnqueued(
"20140801_010203", "gs://somebucket/some_backup_20140801.backup_info", "one");
}
@Test
public void testPost_forCompleteBackup_withEmptyKindsToLoad_skipsLoadTask() throws Exception {
action.kindsToLoadParam = "";
action.run();
assertNoTasksEnqueued("export-snapshot");
}
@Test
public void testPost_forBadBackup_returnsBadRequest() throws Exception {
when(backupService.findByName("some_backup"))
.thenThrow(new IllegalArgumentException("No backup found"));
thrown.expect(BadRequestException.class, "Bad backup name some_backup: No backup found");
action.run();
}
@Test
public void testGet_returnsInformation() throws Exception {
action.requestMethod = Method.GET;
action.run();
assertThat(response.getPayload())
.isEqualTo(
Joiner.on("\n")
.join(
ImmutableList.of(
"Backup name: some_backup",
"Status: COMPLETE",
"Started: 2014-08-01T01:02:03.000Z",
"Ended: 2014-08-01T01:32:03.000Z",
"Duration: 30m",
"GCS: gs://somebucket/some_backup_20140801.backup_info",
"Kinds: [one, two, three]",
"")));
}
@Test
public void testGet_forBadBackup_returnsError() throws Exception {
action.requestMethod = Method.GET;
when(backupService.findByName("some_backup"))
.thenThrow(new IllegalArgumentException("No backup found"));
thrown.expect(BadRequestException.class, "Bad backup name some_backup: No backup found");
action.run();
}
}

View file

@ -1,263 +0,0 @@
// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.export;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.export.CheckSnapshotServlet.SNAPSHOT_KINDS_TO_LOAD_PARAM;
import static google.registry.export.CheckSnapshotServlet.SNAPSHOT_NAME_PARAM;
import static google.registry.testing.TaskQueueHelper.assertNoTasksEnqueued;
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
import static javax.servlet.http.HttpServletResponse.SC_ACCEPTED;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;
import static javax.servlet.http.HttpServletResponse.SC_OK;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.testing.AppEngineRule;
import google.registry.testing.FakeClock;
import google.registry.testing.InjectRule;
import google.registry.testing.TaskQueueHelper.TaskMatcher;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/** Unit tests for {@link CheckSnapshotServlet}. */
@RunWith(MockitoJUnitRunner.class)
public class CheckSnapshotServletTest {
static final DateTime START_TIME = DateTime.parse("2014-08-01T01:02:03Z");
static final DateTime COMPLETE_TIME = START_TIME.plus(Duration.standardMinutes(30));
@Rule
public final InjectRule inject = new InjectRule();
@Rule
public final AppEngineRule appEngine = AppEngineRule.builder()
.withTaskQueue()
.build();
@Mock
private HttpServletRequest req;
@Mock
private HttpServletResponse rsp;
private DatastoreBackupInfo backupInfo;
@Mock
private DatastoreBackupService backupService;
private final FakeClock clock = new FakeClock(COMPLETE_TIME.plusMillis(1000));
private final StringWriter httpOutput = new StringWriter();
private final CheckSnapshotServlet servlet = new CheckSnapshotServlet();
@Before
public void before() throws Exception {
inject.setStaticField(CheckSnapshotServlet.class, "backupService", backupService);
inject.setStaticField(DatastoreBackupInfo.class, "clock", clock);
when(rsp.getWriter()).thenReturn(new PrintWriter(httpOutput));
servlet.init(mock(ServletConfig.class));
when(req.getMethod()).thenReturn("POST");
backupInfo = new DatastoreBackupInfo(
"some_backup",
START_TIME,
Optional.of(COMPLETE_TIME),
ImmutableSet.of("one", "two", "three"),
Optional.of("gs://somebucket/some_backup_20140801.backup_info"));
}
private void setPendingBackup() {
backupInfo = new DatastoreBackupInfo(
backupInfo.getName(),
backupInfo.getStartTime(),
Optional.<DateTime>absent(),
backupInfo.getKinds(),
backupInfo.getGcsFilename());
}
private static void assertLoadTaskEnqueued(String id, String file, String kinds)
throws Exception {
assertTasksEnqueued(
"export-snapshot",
new TaskMatcher()
.url("/_dr/task/loadSnapshot")
.method("POST")
.param("id", id)
.param("file", file)
.param("kinds", kinds));
}
@Test
public void testSuccess_enqueuePollTask() throws Exception {
servlet.enqueuePollTask("some_snapshot_name", ImmutableSet.of("one", "two", "three"));
assertTasksEnqueued(CheckSnapshotServlet.QUEUE,
new TaskMatcher()
.url(CheckSnapshotServlet.PATH)
.param(SNAPSHOT_NAME_PARAM, "some_snapshot_name")
.param(SNAPSHOT_KINDS_TO_LOAD_PARAM, "one,two,three")
.method("POST"));
}
@Test
public void testPost_forPendingBackup_returnsNotModified() throws Exception {
setPendingBackup();
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).sendError(SC_NOT_MODIFIED, "Datastore backup some_backup still pending");
}
@Test
public void testPost_forStalePendingBackupBackup_returnsAccepted() throws Exception {
setPendingBackup();
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
clock.setTo(START_TIME
.plus(Duration.standardHours(20))
.plus(Duration.standardMinutes(3))
.plus(Duration.millis(1234)));
servlet.service(req, rsp);
verify(rsp).sendError(SC_ACCEPTED,
"Datastore backup some_backup abandoned - "
+ "not complete after 20 hours, 3 minutes and 1 second");
}
@Test
public void testPost_forCompleteBackup_enqueuesLoadTask() throws Exception {
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
assertLoadTaskEnqueued(
"20140801_010203", "gs://somebucket/some_backup_20140801.backup_info", "one,two");
}
@Test
public void testPost_forCompleteAutoBackup_enqueuesLoadTask_usingBackupName() throws Exception {
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("auto_snapshot_somestring");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
when(backupService.findByName("auto_snapshot_somestring")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
assertLoadTaskEnqueued(
"somestring", "gs://somebucket/some_backup_20140801.backup_info", "one,two");
}
@Test
public void testPost_forCompleteBackup_withExtraKindsToLoad_enqueuesLoadTask() throws Exception {
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,foo");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
assertLoadTaskEnqueued(
"20140801_010203", "gs://somebucket/some_backup_20140801.backup_info", "one");
}
@Test
public void testPost_forCompleteBackup_withEmptyKindsToLoad_skipsLoadTask() throws Exception {
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
assertNoTasksEnqueued("export-snapshot");
}
@Test
public void testPost_forBadBackup_returnsBadRequest() throws Exception {
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
when(backupService.findByName("some_backup"))
.thenThrow(new IllegalArgumentException("No backup found"));
servlet.service(req, rsp);
verify(rsp).sendError(SC_BAD_REQUEST, "Bad backup name some_backup: No backup found");
}
@Test
public void testPost_noBackupSpecified_returnsError() throws Exception {
when(req.getMethod()).thenReturn("POST");
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn(null);
when(req.getParameter(SNAPSHOT_KINDS_TO_LOAD_PARAM)).thenReturn("one,two");
servlet.service(req, rsp);
verify(rsp).sendError(SC_BAD_REQUEST, "Missing parameter: name");
}
@Test
public void testGet_returnsInformation() throws Exception {
when(req.getMethod()).thenReturn("GET");
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
assertThat(httpOutput.toString()).isEqualTo("OK\n\n" + Joiner.on("\n").join(ImmutableList.of(
"Backup name: some_backup",
"Status: COMPLETE",
"Started: 2014-08-01T01:02:03.000Z",
"Ended: 2014-08-01T01:32:03.000Z",
"Duration: 30m",
"GCS: gs://somebucket/some_backup_20140801.backup_info",
"Kinds: [one, two, three]",
"")));
}
@Test
public void testGet_forBadBackup_returnsError() throws Exception {
when(req.getMethod()).thenReturn("GET");
when(req.getParameter(SNAPSHOT_NAME_PARAM)).thenReturn("some_backup");
when(backupService.findByName("some_backup")).thenThrow(
new IllegalArgumentException("No backup found"));
servlet.service(req, rsp);
verify(rsp).sendError(SC_BAD_REQUEST, "No backup found");
}
@Test
public void testGet_noBackupSpecified_returnsError() throws Exception {
when(req.getMethod()).thenReturn("GET");
servlet.service(req, rsp);
verify(rsp).sendError(SC_BAD_REQUEST, "Missing parameter: name");
}
}

View file

@ -0,0 +1,76 @@
// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.export;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.export.CheckSnapshotAction.CHECK_SNAPSHOT_KINDS_TO_LOAD_PARAM;
import static google.registry.export.CheckSnapshotAction.CHECK_SNAPSHOT_NAME_PARAM;
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
import static org.mockito.Mockito.verify;
import com.google.common.base.Joiner;
import google.registry.testing.AppEngineRule;
import google.registry.testing.FakeClock;
import google.registry.testing.FakeResponse;
import google.registry.testing.TaskQueueHelper.TaskMatcher;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/** Unit tests for {@link ExportSnapshotAction}. */
@RunWith(MockitoJUnitRunner.class)
public class ExportSnapshotActionTest {
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withTaskQueue().build();
@Mock private DatastoreBackupService backupService;
private final FakeResponse response = new FakeResponse();
private final FakeClock clock = new FakeClock(DateTime.parse("2014-08-01T01:02:03Z"));
private final ExportSnapshotAction action = new ExportSnapshotAction();
@Before
public void before() throws Exception {
action.clock = clock;
action.backupService = backupService;
action.response = response;
}
@Test
public void testPost_launchesBackup_andEnqueuesPollTask() throws Exception {
action.run();
verify(backupService)
.launchNewBackup(
ExportSnapshotAction.QUEUE,
"auto_snapshot_20140801_010203",
"domain-registry-snapshots",
ExportConstants.getBackupKinds());
assertTasksEnqueued(
CheckSnapshotAction.QUEUE,
new TaskMatcher()
.url(CheckSnapshotAction.PATH)
.param(CHECK_SNAPSHOT_NAME_PARAM, "auto_snapshot_20140801_010203")
.param(
CHECK_SNAPSHOT_KINDS_TO_LOAD_PARAM,
Joiner.on(",").join(ExportConstants.getReportingKinds()))
.method("POST"));
assertThat(response.getPayload())
.isEqualTo("Datastore backup started with name: auto_snapshot_20140801_010203");
}
}

View file

@ -1,87 +0,0 @@
// Copyright 2016 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.export;
import static javax.servlet.http.HttpServletResponse.SC_OK;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import google.registry.testing.FakeClock;
import google.registry.testing.InjectRule;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
/** Unit tests for {@link ExportSnapshotServlet}. */
@RunWith(MockitoJUnitRunner.class)
public class ExportSnapshotServletTest {
@Rule
public final InjectRule inject = new InjectRule();
@Mock
private HttpServletRequest req;
@Mock
private HttpServletResponse rsp;
@Mock
private DatastoreBackupService backupService;
@Mock
private CheckSnapshotServlet checkSnapshotServlet;
private final FakeClock clock = new FakeClock();
private final StringWriter httpOutput = new StringWriter();
private final ExportSnapshotServlet servlet = new ExportSnapshotServlet();
private static final DateTime START_TIME = DateTime.parse("2014-08-01T01:02:03Z");
@Before
public void before() throws Exception {
clock.setTo(START_TIME);
inject.setStaticField(ExportSnapshotServlet.class, "clock", clock);
inject.setStaticField(ExportSnapshotServlet.class, "backupService", backupService);
inject.setStaticField(
ExportSnapshotServlet.class, "checkSnapshotServlet", checkSnapshotServlet);
when(rsp.getWriter()).thenReturn(new PrintWriter(httpOutput));
servlet.init(mock(ServletConfig.class));
when(req.getMethod()).thenReturn("POST");
}
@Test
public void testPost_launchesBackup_andEnqueuesPollTask() throws Exception {
servlet.service(req, rsp);
verify(rsp).setStatus(SC_OK);
verify(backupService).launchNewBackup(
ExportSnapshotServlet.QUEUE,
"auto_snapshot_20140801_010203",
"domain-registry-snapshots",
ExportConstants.getBackupKinds());
verify(checkSnapshotServlet)
.enqueuePollTask("auto_snapshot_20140801_010203", ExportConstants.getReportingKinds());
}
}