From 41ebc47800a19ddfbec34d1159b92470a01a748d Mon Sep 17 00:00:00 2001
From: mykola2312 <49044616+mykola2312@users.noreply.github.com>
Date: Mon, 8 Apr 2024 08:36:00 +0300
Subject: [PATCH] configure unit testing for project
---
pom.xml | 22 ++++++++++++++++++-
.../java/com/mykola2312/mptv/TestI18n.java | 17 ++++++++++++++
src/test/resources/i18n_en_US.properties | 2 ++
3 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 src/test/java/com/mykola2312/mptv/TestI18n.java
create mode 100644 src/test/resources/i18n_en_US.properties
diff --git a/pom.xml b/pom.xml
index b194d3e..be9cde1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.mykola2312
mptv
- 0.1.0
+ 1.0-SNAPSHOT
UTF-8
@@ -12,4 +12,24 @@
22
com.mykola2312.mptv.Main
+
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.10.2
+ test
+
+
+
+
+ mptv
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.2.5
+
+
+
\ No newline at end of file
diff --git a/src/test/java/com/mykola2312/mptv/TestI18n.java b/src/test/java/com/mykola2312/mptv/TestI18n.java
new file mode 100644
index 0000000..7da8f47
--- /dev/null
+++ b/src/test/java/com/mykola2312/mptv/TestI18n.java
@@ -0,0 +1,17 @@
+package com.mykola2312.mptv;
+
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class TestI18n {
+ @Test()
+ public void testKeys() {
+ assertEquals("Value1", I18n.get("Key1"));
+ assertEquals("Value2", I18n.get("Key2"));
+ }
+
+ @Test()
+ public void testNotFound() {
+ assertEquals("KeyNotFound", I18n.get("KeyNotFound"));
+ }
+}
diff --git a/src/test/resources/i18n_en_US.properties b/src/test/resources/i18n_en_US.properties
new file mode 100644
index 0000000..82562f3
--- /dev/null
+++ b/src/test/resources/i18n_en_US.properties
@@ -0,0 +1,2 @@
+Key1=Value1
+Key2=Value2
\ No newline at end of file