From 6dd7821cd38c69b9fdc3172762744f32dcbf9606 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 13 Apr 2023 13:42:44 +0200 Subject: obfs4-hop enum value - improve handling of disallowed dashes in enums --- .../openvpn/core/connection/ConnectionTest.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java (limited to 'app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java') diff --git a/app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java b/app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java new file mode 100644 index 00000000..6313bc82 --- /dev/null +++ b/app/src/test/java/de/blinkt/openvpn/core/connection/ConnectionTest.java @@ -0,0 +1,33 @@ +package de.blinkt.openvpn.core.connection; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static de.blinkt.openvpn.core.connection.Connection.TransportType.OBFS4_HOP; + +import org.junit.Test; + +public class ConnectionTest { + + @Test + public void TransportTypeTest_fromString() { + Connection.TransportType transportType = Connection.TransportType.fromString("obfs4-hop"); + assertEquals(OBFS4_HOP, transportType); + } + + @Test + public void TransportTypeTest_toString() { + assertEquals("obfs4-hop", OBFS4_HOP.toString()); + } + + @Test + public void TransportTypeTest_valueOf() { + Exception exception = null; + try { + Connection.TransportType.valueOf("obfs4-hop"); + } catch (IllegalArgumentException e) { + exception = e; + } + assertNotNull(exception); + } + +} -- cgit v1.2.3