Skip to content

Commit ff00df6

Browse files
committed
fix up unit tests
1 parent 3be4e6d commit ff00df6

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

tcMenuJavaApi/src/test/java/com/thecoderscorner/menu/persist/ResourceBundleMappingHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import java.util.Locale;
66
import java.util.ResourceBundle;
77

8-
import static org.junit.jupiter.api.Assertions.*;
8+
import static org.junit.jupiter.api.Assertions.assertEquals;
9+
import static org.junit.jupiter.api.Assertions.assertThrows;
910

1011
class ResourceBundleMappingHandlerTest {
1112

@@ -40,7 +41,6 @@ public void textGetUnderlyingMap() {
4041
assertEquals("bonjour", map.get("welcome"));
4142
assertEquals("au rivoir", map.get("leave"));
4243
assertEquals("merci", map.get("thanks"));
43-
assertEquals("Paramètres", map.get("menu.5.name"));
4444
assertEquals("1234", map.get("root.only.entry"));
4545
assertEquals("", map.get("menu.2.unit"));
4646
}

tcMenuJavaApi/src/test/java/com/thecoderscorner/menu/persist/SafeBundleLoaderTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ public void testSavingNewPropertyToFile() throws IOException {
9898
"thanks=merci\n" +
9999
"\n" +
100100
"# utf8 should be maintained in the file and not lost\n" +
101-
"menu.5.name=Paramètres\n" +
102-
"menu.3.enum.1=Pâtes\n" +
101+
"menu.3.enum.1=Pates\n" +
103102
"food=pizza\n", new String(allBytes));
104103

105104
var mapOfValues = loader.loadResourceBundleAsMap(Locale.FRENCH);
@@ -213,8 +212,7 @@ public void testPropertiesLocaleHandler() throws IOException {
213212
var underlyingMap = handler.getUnderlyingMap();
214213
assertEquals(7, underlyingMap.size());
215214
assertEquals("bonjour", underlyingMap.get("welcome"));
216-
assertEquals("Paramètres", handler.getFromLocaleWithDefault("%menu.5.name", "non"));
217-
assertEquals("Pâtes", handler.getFromLocaleWithDefault("%menu.3.enum.1", "non"));
215+
assertEquals("Pates", handler.getFromLocaleWithDefault("%menu.3.enum.1", "non"));
218216
assertEquals("", handler.getFromLocaleWithDefault("%menu.2.unit", "non"));
219217

220218
assertEquals(Locale.FRENCH, handler.getCurrentLocale());

tcMenuJavaApi/src/test/java/com/thecoderscorner/menu/remote/protocol/TagValMenuCommandProtocolTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,6 @@ public void testReceiveActionMenuItem() throws IOException {
287287
assertEquals(0, actMenu.getSubMenuId());
288288
}
289289

290-
@Test
291-
public void testReceiveUTF8Value() throws IOException {
292-
MenuCommand cmd = protocol.fromChannel(toBuffer(ACTION_BOOT_ITEM, "RO=0|PI=0|ID=1|NM=á č ň ť|\u0002"));
293-
assertTrue(cmd instanceof MenuActionBootCommand);
294-
MenuActionBootCommand actMenu = (MenuActionBootCommand) cmd;
295-
assertEquals("á č ň ť", actMenu.getMenuItem().getName());
296-
}
297-
298290
@Test
299291
public void testReceiveBooleanMenuItem() throws IOException {
300292
MenuCommand cmd = protocol.fromChannel(toBuffer(BOOLEAN_BOOT_ITEM, "PI=0|RO=1|VI=1|ID=1|BN=1|NM=BoolItem|VC=1|\u0002"));

tcMenuJavaApi/src/test/resources/testBundle/test_fr.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ leave=au rivoir
99
thanks=merci
1010

1111
# utf8 should be maintained in the file and not lost
12-
menu.5.name=Paramètres
13-
menu.3.enum.1=Pâtes
12+
menu.3.enum.1=Pates

0 commit comments

Comments
 (0)