diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 15:07:40 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-20 15:07:40 +0200 |
| commit | 2a619ceba75a4c16b25de12d59a87eac795a4468 (patch) | |
| tree | 1d63a35217011fa761b703633b3f91fd839ec71e /wrappers/java-android/lib/src/test | |
| parent | 7e309b67de74fe5bd5a1c70c1880c2a381c4f78b (diff) | |
Remove: unused wrappers
Diffstat (limited to 'wrappers/java-android/lib/src/test')
| -rw-r--r-- | wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java b/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java deleted file mode 100644 index 92a4648..0000000 --- a/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.eduvpn.common; - -import org.apache.commons.io.IOUtils; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -public class VerifyTests { - private static byte[] readAll(String resource) throws IOException { - try (InputStream stream = VerifyTests.class.getResourceAsStream(resource)) { - return IOUtils.toByteArray(stream); - } - } - - @SuppressWarnings("OptionalGetWithoutIsPresent") - @BeforeClass - public static void oneTimeSetup() throws IOException { - try (BufferedReader reader = new BufferedReader(new InputStreamReader( - VerifyTests.class.getResourceAsStream("public.key")))) { - Discovery.insecureTestingSetExtraKey(reader.lines().reduce((a, b) -> b).get()); - } - } - - @Test - public void testValid() throws IOException, VerifyException { - Discovery.verify( - readAll("server_list.json.minisig"), - readAll("server_list.json"), - "server_list.json", - 10 - ); - } - - @Test(expected = InvalidSignatureException.class) - public void testInvalidSignature() throws IOException, VerifyException { - Discovery.verify( - readAll("random.txt"), - readAll("server_list.json"), - "server_list.json", - 0 - ); - } - - @Test(expected = InvalidSignatureUnknownKeyException.class) - public void testWrongKey() throws IOException, VerifyException { - Discovery.verify( - readAll("server_list.json.wrong_key.minisig"), - readAll("server_list.json"), - "server_list.json", - 0 - ); - } - - @Test(expected = SignatureTooOldException.class) - public void testOldSignature() throws IOException, VerifyException { - Discovery.verify( - readAll("server_list.json.minisig"), - readAll("server_list.json"), - "server_list.json", - 11 - ); - } - - @Test(expected = IllegalArgumentException.class) - public void testUnknownExpectedFile() throws IOException, VerifyException { - Discovery.verify( - readAll("other_list.json.minisig"), - readAll("other_list.json"), - "other_list.json", - 0 - ); - } -} |
