mirror of
https://github.com/google/nomulus
synced 2026-09-20 15:04:24 +00:00
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:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user