JDK 11 min requirements because of LTS.
This commit is contained in:
parent
dcd6996c39
commit
c88be2b4e5
10 changed files with 22 additions and 40 deletions
|
@ -14,13 +14,13 @@ import java.time.*;
|
|||
public final class ReleaseInfo {
|
||||
public static final String PROJECT = "mobibot";
|
||||
public static final LocalDateTime BUILDDATE =
|
||||
LocalDateTime.ofInstant(Instant.ofEpochMilli(1592043035449L), ZoneId.systemDefault());
|
||||
LocalDateTime.ofInstant(Instant.ofEpochMilli(1592615322387L), ZoneId.systemDefault());
|
||||
public static final int MAJOR = 0;
|
||||
public static final int MINOR = 8;
|
||||
public static final int PATCH = 0;
|
||||
public static final String PRERELEASE = "beta";
|
||||
public static final String BUILDMETA = "004";
|
||||
public static final String VERSION = "0.8.0-beta+004";
|
||||
public static final String BUILDMETA = "046";
|
||||
public static final String VERSION = "0.8.0-beta+046";
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
|
|
|
@ -36,18 +36,12 @@ import net.thauvin.erik.mobibot.entries.EntryLink
|
|||
import net.thauvin.erik.pinboard.PinboardPoster
|
||||
import org.testng.Assert
|
||||
import org.testng.annotations.Test
|
||||
import java.io.IOException
|
||||
import java.net.URI
|
||||
import java.net.URISyntaxException
|
||||
import java.net.URL
|
||||
import java.net.URLEncoder
|
||||
import java.net.http.HttpClient
|
||||
import java.net.http.HttpRequest
|
||||
import java.net.http.HttpResponse
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
class PinboardUtilsTest : LocalProperties() {
|
||||
@Test
|
||||
@Throws(InterruptedException::class, IOException::class, URISyntaxException::class)
|
||||
fun pinboardTest() {
|
||||
val apiToken = getProperty("pinboard-api-token")
|
||||
val pinboard = PinboardPoster(apiToken)
|
||||
|
@ -66,21 +60,10 @@ class PinboardUtilsTest : LocalProperties() {
|
|||
Assert.assertFalse(validatePin(apiToken, url = entry.link), "delete")
|
||||
}
|
||||
|
||||
@Throws(IOException::class, URISyntaxException::class, InterruptedException::class)
|
||||
private fun validatePin(apiToken: String, ircServer: String = "", url: String): Boolean {
|
||||
val request = HttpRequest.newBuilder().uri(
|
||||
URI(
|
||||
"https://api.pinboard.in/v1/posts/get?auth_token=${apiToken}&tag=test&"
|
||||
+ URLEncoder.encode(url, StandardCharsets.UTF_8)
|
||||
)
|
||||
).GET().build()
|
||||
val response = Utils.urlReader(URL("https://api.pinboard.in/v1/posts/get?auth_token=${apiToken}&tag=test&"
|
||||
+ URLEncoder.encode(url, StandardCharsets.UTF_8)))
|
||||
|
||||
val response = HttpClient.newBuilder()
|
||||
.build()
|
||||
.send(request, HttpResponse.BodyHandlers.ofString())
|
||||
|
||||
return if (response.statusCode() == 200) {
|
||||
response.body().contains(url) && response.body().contains(ircServer)
|
||||
} else false
|
||||
return response.contains(url) && response.contains(ircServer)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue