mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Update signed marks files and add an expiration test
We'll continue to use injected clocks for the rest of our tests that use signed marks files, so that they don't all fail after the current validity period. The new test TmchTestDataExpirationTest will let us know when the files are expired, so we can update them. All updated test data files come from https://newgtlds.icann.org/en/about/trademark-clearinghouse/registries-registrars ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202208196
This commit is contained in:
parent
11c5d11a29
commit
892c1fc707
95 changed files with 6574 additions and 6461 deletions
|
@ -19,7 +19,14 @@ import static google.registry.util.ResourceUtils.readResourceBytes;
|
|||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.io.ByteSource;
|
||||
import com.google.common.io.MoreFiles;
|
||||
import com.google.common.io.Resources;
|
||||
import java.net.URI;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@ -82,4 +89,11 @@ public final class TestDataHelper {
|
|||
String packagePath = context.getPackage().getName().replace('.', '/');
|
||||
return String.format("javatests/%s/testdata/%s", packagePath, filename);
|
||||
}
|
||||
|
||||
/** Returns a recursive iterable of all files in the given directory. */
|
||||
public static Iterable<Path> listFiles(Class<?> context, String directory) throws Exception {
|
||||
URI dir = Resources.getResource(context, directory).toURI();
|
||||
FileSystems.newFileSystem(dir, ImmutableMap.of("create", "true"));
|
||||
return MoreFiles.fileTraverser().breadthFirst(Paths.get(dir));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue