source: josm/trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java@ 17442

Last change on this file since 17442 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5
6import java.io.StringReader;
7import java.net.HttpURLConnection;
8import java.net.URL;
9
10import javax.json.Json;
11
12import org.junit.jupiter.api.Test;
13import org.junit.jupiter.api.extension.RegisterExtension;
14import org.openstreetmap.josm.testutils.JOSMTestRules;
15
16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
17
18/**
19 * Integration tests of {@link PlatformHook} class.
20 */
21class PlatformHookTestIT {
22
23 /**
24 * Setup rule
25 */
26 @RegisterExtension
27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
28 public JOSMTestRules test = new JOSMTestRules();
29
30 /**
31 * Test that we always support the latest Ubuntu version.
32 * @throws Exception in case of error
33 */
34 @Test
35 void testLatestUbuntuVersion() throws Exception {
36 String latestUbuntuVersion = Json.createReader(new StringReader(HttpClient.create(
37 new URL("https://api.launchpad.net/devel/ubuntu/series")).connect().fetchContent()))
38 .readObject().getJsonArray("entries").getJsonObject(0).getString("name");
39 assertEquals(HttpURLConnection.HTTP_OK, HttpClient.create(
40 new URL("https://josm.openstreetmap.de/apt/dists/" + latestUbuntuVersion + '/')).connect().getResponseCode(),
41 latestUbuntuVersion);
42 }
43}
Note: See TracBrowser for help on using the repository browser.