mirror of
https://github.com/google/nomulus.git
synced 2025-08-16 06:24:07 +02:00
Move SQL files to resources from java (#1879)
This is similar to where we store the SQL files for beam pipelines, and frankly makes more sense. Also streamlined the use of the API to read SQL files from a jar.
This commit is contained in:
parent
0b8e7d1120
commit
1242e3d50c
19 changed files with 8 additions and 24 deletions
|
@ -20,7 +20,6 @@ import static google.registry.tools.GenerateSqlErDiagramCommand.FLYWAY_FILE_ELEM
|
|||
import static google.registry.tools.GenerateSqlErDiagramCommand.getLastFlywayFileName;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.io.Resources;
|
||||
import google.registry.util.ResourceUtils;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
|
@ -61,16 +60,14 @@ class GenerateSqlErDiagramCommandTest extends CommandTestCase<GenerateSqlErDiagr
|
|||
void validateErDiagramIsUpToDate() {
|
||||
String goldenFullDiagram =
|
||||
ResourceUtils.readResourceUtf8(
|
||||
Resources.getResource(
|
||||
Paths.get(GOLDEN_DIAGRAM_FOLDER).resolve("full_er_diagram.html").toString()));
|
||||
Paths.get(GOLDEN_DIAGRAM_FOLDER).resolve("full_er_diagram.html").toString());
|
||||
assertWithMessage(UPDATE_INSTRUCTIONS)
|
||||
.that(Jsoup.parse(goldenFullDiagram).getElementById(FLYWAY_FILE_ELEMENT_ID).text())
|
||||
.isEqualTo(getLastFlywayFileName());
|
||||
|
||||
String briefFullDiagram =
|
||||
ResourceUtils.readResourceUtf8(
|
||||
Resources.getResource(
|
||||
Paths.get(GOLDEN_DIAGRAM_FOLDER).resolve("brief_er_diagram.html").toString()));
|
||||
Paths.get(GOLDEN_DIAGRAM_FOLDER).resolve("brief_er_diagram.html").toString());
|
||||
assertWithMessage(UPDATE_INSTRUCTIONS)
|
||||
.that(Jsoup.parse(briefFullDiagram).getElementById(FLYWAY_FILE_ELEMENT_ID).text())
|
||||
.isEqualTo(getLastFlywayFileName());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue