mirror of
https://github.com/google/nomulus
synced 2026-08-21 22:56:19 +00:00
Add logging to CursorDao.saveCursor (#486)
* Add log messages * small fix * add null check * change to checkArgumentNotNull
This commit is contained in:
@@ -190,27 +190,6 @@ public class CursorDaoTest {
|
||||
assertThat(cursor).isEqualTo(dataStoreCursor);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void saveCursor_logsErrorWhenSaveToCloudSqlFails() {
|
||||
loggerToIntercept.addHandler(logHandler);
|
||||
createTld("tld");
|
||||
google.registry.model.common.Cursor cursor =
|
||||
google.registry.model.common.Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, fakeClock.nowUtc(), Registry.get("tld"));
|
||||
CursorDao.saveCursor(cursor, null);
|
||||
assertAboutLogs()
|
||||
.that(logHandler)
|
||||
.hasLogAtLevelWithMessage(Level.SEVERE, "Error saving cursor to Cloud SQL.");
|
||||
google.registry.model.common.Cursor dataStoreCursor =
|
||||
ofy()
|
||||
.load()
|
||||
.key(
|
||||
google.registry.model.common.Cursor.createKey(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("tld")))
|
||||
.now();
|
||||
assertThat(cursor).isEqualTo(dataStoreCursor);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void saveCursors_worksSuccessfully() {
|
||||
createTlds("tld", "foo");
|
||||
|
||||
Reference in New Issue
Block a user