summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2024-05-15 17:27:04 +0200
committerPaul-Christian Volkmer2024-05-15 17:27:04 +0200
commite9839c27310bc2e1294efb52c98f2b4f04d35e62 (patch)
tree356b095e410ebcba7b052e93558d31ece46e59a3
parent86bee9e2cf5c97d1339d2cde59b3361e88973a7d (diff)
fix: add missing 'fatal' severity
-rw-r--r--src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt1
-rw-r--r--src/main/resources/templates/report.html1
-rw-r--r--src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt19
3 files changed, 13 insertions, 8 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt
index ccbbe1c..97ecd05 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt
@@ -57,6 +57,7 @@ class ReportService(
data class Issue(val severity: Severity, val message: String)
enum class Severity(@JsonValue val value: String) {
+ FATAL("fatal"),
ERROR("error"),
WARNING("warning"),
INFO("info")
diff --git a/src/main/resources/templates/report.html b/src/main/resources/templates/report.html
index 6f89345..07f987c 100644
--- a/src/main/resources/templates/report.html
+++ b/src/main/resources/templates/report.html
@@ -55,6 +55,7 @@
<td th:if="${issue.severity.value == 'info'}" class="bg-blue"><small>[[ ${issue.severity} ]]</small></td>
<td th:if="${issue.severity.value == 'warning'}" class="bg-yellow"><small>[[ ${issue.severity} ]]</small></td>
<td th:if="${issue.severity.value == 'error'}" class="bg-red"><small>[[ ${issue.severity} ]]</small></td>
+ <td th:if="${issue.severity.value == 'fatal'}" class="bg-red"><small>[[ ${issue.severity} ]]</small></td>
<td>[[ ${issue.message} ]]</td>
</tr>
</tbody>
diff --git a/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt
index f0f6230..349202a 100644
--- a/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt
+++ b/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt
@@ -43,20 +43,23 @@ class ReportServiceTest {
"issues": [
{ "severity": "info", "message": "Info Message" },
{ "severity": "warning", "message": "Warning Message" },
- { "severity": "error", "message": "Error Message" }
+ { "severity": "error", "message": "Error Message" },
+ { "severity": "fatal", "message": "Fatal Message" }
]
}
""".trimIndent()
val actual = this.reportService.deserialize(json)
- assertThat(actual).hasSize(3)
- assertThat(actual[0].severity).isEqualTo(ReportService.Severity.ERROR)
- assertThat(actual[0].message).isEqualTo("Error Message")
- assertThat(actual[1].severity).isEqualTo(ReportService.Severity.WARNING)
- assertThat(actual[1].message).isEqualTo("Warning Message")
- assertThat(actual[2].severity).isEqualTo(ReportService.Severity.INFO)
- assertThat(actual[2].message).isEqualTo("Info Message")
+ assertThat(actual).hasSize(4)
+ assertThat(actual[0].severity).isEqualTo(ReportService.Severity.FATAL)
+ assertThat(actual[0].message).isEqualTo("Fatal Message")
+ assertThat(actual[1].severity).isEqualTo(ReportService.Severity.ERROR)
+ assertThat(actual[1].message).isEqualTo("Error Message")
+ assertThat(actual[2].severity).isEqualTo(ReportService.Severity.WARNING)
+ assertThat(actual[2].message).isEqualTo("Warning Message")
+ assertThat(actual[3].severity).isEqualTo(ReportService.Severity.INFO)
+ assertThat(actual[3].message).isEqualTo("Info Message")
}
@Test