mirror of
https://github.com/google/nomulus.git
synced 2025-05-29 08:50:09 +02:00
In ExportConstantsTest, write path to golden file instead of contents
In my previous refactoring I failed to realize that getResource() was not returning the contents of the file. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=142065550
This commit is contained in:
parent
1ed1ba20ba
commit
352ef13160
1 changed files with 3 additions and 4 deletions
|
@ -15,6 +15,7 @@
|
|||
package google.registry.export;
|
||||
|
||||
import static com.google.common.base.Strings.repeat;
|
||||
import static com.google.common.io.Resources.getResource;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static google.registry.export.ExportConstants.getBackupKinds;
|
||||
|
@ -28,7 +29,6 @@ import com.google.common.collect.FluentIterable;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.re2j.Pattern;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -70,16 +70,15 @@ public class ExportConstantsTest {
|
|||
|
||||
private static void checkKindsMatchGoldenFile(
|
||||
String kindsName, String goldenFilename, ImmutableSet<String> actualKinds) {
|
||||
List<String> goldenKinds = extractListFromFile(goldenFilename);
|
||||
String updateInstructions =
|
||||
String.format(
|
||||
UPDATE_INSTRUCTIONS_TEMPLATE,
|
||||
kindsName,
|
||||
Joiner.on('\n').join(goldenKinds),
|
||||
getResource(ExportConstantsTest.class, goldenFilename).toString(),
|
||||
Joiner.on('\n').join(actualKinds));
|
||||
assertWithMessage(updateInstructions)
|
||||
.that(actualKinds)
|
||||
.containsExactlyElementsIn(goldenKinds)
|
||||
.containsExactlyElementsIn(extractListFromFile(goldenFilename))
|
||||
.inOrder();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue