Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-mk committed Dec 15, 2023
2 parents 193c532 + 2d1fa15 commit 930fcf6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ import org.junit.jupiter.api.Test

class TimeMachineTest {
private val filePathAmendingLaw =
this.javaClass.classLoader.getResource("07_01_aenderungsgesetz.xml")?.path
this.javaClass.classLoader.getResource("07_01_änderungsgesetz.xml")?.toURI()
private val fileNameToBeAmendedLaw = "07_01_zuänderndesgesetz.xml"
private val filePathToBeAmendedLaw =
this.javaClass.classLoader.getResource("07_01_zuaenderndesgesetz.xml")?.path
this.javaClass.classLoader.getResource(fileNameToBeAmendedLaw)?.toURI()

@Test
fun `return amended law with changed text when given to-be-amended law and amending law`() {
val command = TimeMachine()
val workingDir = Paths.get("").toAbsolutePath().toString()
val fileNameWithoutType =
filePathToBeAmendedLaw?.substringBeforeLast(".")?.substringAfterLast("/")
val resultFromFile = File(workingDir + "/" + fileNameWithoutType + "_amended.xml")
val absolutePathResult =
workingDir + "/" + fileNameToBeAmendedLaw.substringBeforeLast(".") + "_amended.xml"
val resultFromFile = File(Paths.get(absolutePathResult).toUri())

command.test("$filePathAmendingLaw $filePathToBeAmendedLaw")
command.test("${filePathAmendingLaw?.path} ${filePathToBeAmendedLaw?.path}")

assertThat(resultFromFile).exists()
assertThat(resultFromFile).isFile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import org.junit.jupiter.api.Test

class FileToDocumentConverterTest {

private val filePath = this.javaClass.classLoader.getResource("07_01_aenderungsgesetz.xml")?.path
private val filePath =
this.javaClass.classLoader.getResource("07_01_änderungsgesetz.xml")?.toURI()
private val amendingLawFile = File(filePath!!)

@Test
Expand Down

0 comments on commit 930fcf6

Please sign in to comment.