Move all testdata reads to use TestDataHelper, and made tests more fluent

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192204510
This commit is contained in:
guyben 2018-04-09 16:11:14 -07:00 committed by Ben McIlwain
parent a8b6195ce2
commit 24498ff97b
7 changed files with 56 additions and 58 deletions

View file

@ -14,9 +14,6 @@
package google.registry.module.tools;
import static com.google.common.io.Resources.getResource;
import google.registry.request.RouterDisplayHelper;
import google.registry.testing.GoldenFileTestHelper;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -28,10 +25,8 @@ public class ToolsRequestComponentTest {
@Test
public void testRoutingMap() throws Exception {
GoldenFileTestHelper.testGoldenFile(
RouterDisplayHelper.extractHumanReadableRoutesFromComponent(ToolsRequestComponent.class),
getResource(ToolsRequestComponentTest.class, "testdata/tools_routing.txt"),
"tools routing map",
"get_routing_map -c " + ToolsRequestComponent.class.getName());
GoldenFileTestHelper.assertThatRoutesFromComponent(ToolsRequestComponent.class)
.describedAs("tools routing map")
.isEqualToGolden(ToolsRequestComponentTest.class, "tools_routing.txt");
}
}