mirror of
https://github.com/google/nomulus.git
synced 2025-07-08 20:23:24 +02:00
Add DuallyWrittenEntity convenience interface (#866)
* Add DuallyWrittenEntity convenience interface For classes that are dually written we don't need to worry about replay conversion, so this just allows us to remove unnecessary unimportant methods * Rename DWE to NonReplicatedEntity and enable test
This commit is contained in:
parent
0c6363c04f
commit
acce1a7d3b
7 changed files with 50 additions and 49 deletions
|
@ -19,6 +19,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
import google.registry.model.common.GaeUserIdConverter;
|
||||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ClassInfo;
|
||||
import io.github.classgraph.ClassInfoList;
|
||||
|
@ -27,7 +28,6 @@ import java.lang.annotation.ElementType;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
|
@ -35,8 +35,10 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class EntityTest {
|
||||
|
||||
private static final ImmutableSet<Class<?>> NON_CONVERTED_CLASSES =
|
||||
ImmutableSet.of(GaeUserIdConverter.class);
|
||||
|
||||
@Test
|
||||
@Disabled("This won't be done until b/152410794 is done, since it requires many entity changes")
|
||||
void testSqlEntityPersistence() {
|
||||
try (ScanResult scanResult =
|
||||
new ClassGraph().enableAnnotationInfo().whitelistPackages("google.registry").scan()) {
|
||||
|
@ -74,6 +76,7 @@ public class EntityTest {
|
|||
.map(ClassInfo::loadClass)
|
||||
.filter(clazz -> !clazz.isAnnotationPresent(EntityForTesting.class))
|
||||
.filter(clazz -> !clazz.isAnnotationPresent(Embed.class))
|
||||
.filter(clazz -> !NON_CONVERTED_CLASSES.contains(clazz))
|
||||
.map(Class::getName)
|
||||
.collect(toImmutableSet());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue