Remove TM references from GaeUserIdConverter (#1666)

This is the only user of the ofy code that will stick around at least
until we move to the new registrar console. By removing references to
the transaction manager, we will be able to delete all the tm code
without interfering with this.
This commit is contained in:
gbrodman
2022-06-13 11:47:39 -04:00
committed by GitHub
parent 6ff4aaeb1c
commit dcc11379c8
3 changed files with 17 additions and 18 deletions
@@ -15,8 +15,7 @@
package google.registry.model.common;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.persistence.transaction.TransactionManagerFactory.ofyTm;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.model.ofy.ObjectifyService.auditedOfy;
import google.registry.testing.AppEngineExtension;
import org.junit.jupiter.api.AfterEach;
@@ -32,7 +31,7 @@ public class GaeUserIdConverterTest {
@AfterEach
void verifyNoLingeringEntities() {
assertThat(ofyTm().loadAllOf(GaeUserIdConverter.class)).hasSize(0);
assertThat(auditedOfy().load().type(GaeUserIdConverter.class).count()).isEqualTo(0);
}
@Test
@@ -43,9 +42,12 @@ public class GaeUserIdConverterTest {
@Test
void testSuccess_inTransaction() {
tm().transactNew(
() ->
assertThat(GaeUserIdConverter.convertEmailAddressToGaeUserId("example@example.com"))
.matches("[0-9]+"));
auditedOfy()
.transactNew(
() -> {
assertThat(GaeUserIdConverter.convertEmailAddressToGaeUserId("example@example.com"))
.matches("[0-9]+");
return null;
});
}
}