Skip to content

Commit

Permalink
Add a test to test the 200 MB YAML input limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej Zizka committed Aug 26, 2024
1 parent 33619dc commit 15f961a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ target/
.project
*.prefs
.classpath

## Don't publish.
/src/test/resources/largeFiles/report-2024-08-23-part1.json
/src/test/resources/largeFiles/report-2024-08-23-part2.json
/src/test/resources/largeFiles/report-2024-08-23-part3.json
10 changes: 10 additions & 0 deletions src/test/java/ch/zizka/yaml/merger/YamlMergerTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.zizka.yaml.merger

import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.slf4j.Logger
import org.slf4j.LoggerFactory
Expand Down Expand Up @@ -39,6 +40,15 @@ class YamlMergerTest {
Assertions.assertEquals(dbProperties!!["hibernate.dialect"], "org.hibernate.dialect.MySQL5InnoDBDialect", "wrong db url")
}

@Test @Disabled("I need to generate some test data.")
fun testMerge2Files_Large() {
val merged = merger.mergeYamlFiles(arrayOf(
getResourceFile("largeFiles_/report-2024-08-23-part1.json"),
getResourceFile("largeFiles_/report-2024-08-23-part2.json"),
))
val mergedYmlString = merger.exportToString(merged)
}

@Test
fun testMergeFileIntoSelf() {
val merged = merger.mergeYamlFiles(arrayOf(YAML_1, YAML_1))
Expand Down

0 comments on commit 15f961a

Please sign in to comment.