From 60658378f68cc7c67cbea2758c6aef455c115c05 Mon Sep 17 00:00:00 2001 From: StevenWdV Date: Sun, 28 Nov 2021 01:11:48 +0100 Subject: Java wrapper stub --- .../tests/eduvpncommon/VerifyTests.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 wrappers/EduVpnCommon/tests/eduvpncommon/VerifyTests.java (limited to 'wrappers/EduVpnCommon/tests/eduvpncommon/VerifyTests.java') diff --git a/wrappers/EduVpnCommon/tests/eduvpncommon/VerifyTests.java b/wrappers/EduVpnCommon/tests/eduvpncommon/VerifyTests.java new file mode 100644 index 0000000..117f5ef --- /dev/null +++ b/wrappers/EduVpnCommon/tests/eduvpncommon/VerifyTests.java @@ -0,0 +1,31 @@ +package eduvpncommon; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.Instant; + +class VerifyTests { + private static final Path testDataDir = Paths.get("../../test_data"); + + @BeforeAll + static void oneTimeSetup() throws IOException { + Discovery.insecureTestingSetExtraKey(Files.lines(testDataDir.resolve("dummy/public.key")).reduce((a, b) -> b).get()); + } + + @Test + void testValid() throws IOException, VerifyException { + Discovery.verify( + Files.readAllBytes(Paths.get("../../test_data/dummy/server_list.json.minisig")), + Files.readAllBytes(Paths.get("../../test_data/dummy/server_list.json")), + "server_list.json", + Instant.EPOCH + ); + } + + //TODO +} \ No newline at end of file -- cgit v1.2.3