mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
upgrade to dropwizard 4.x
This commit is contained in:
@@ -3,8 +3,6 @@ package com.commafeed.integration.rest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ws.rs.client.Entity;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -15,6 +13,8 @@ import com.commafeed.frontend.model.UserModel;
|
||||
import com.commafeed.frontend.model.request.IDRequest;
|
||||
import com.commafeed.integration.BaseIT;
|
||||
|
||||
import jakarta.ws.rs.client.Entity;
|
||||
|
||||
class AdminIT extends BaseIT {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -6,10 +6,6 @@ import java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.ws.rs.client.Entity;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.awaitility.Awaitility;
|
||||
@@ -31,6 +27,10 @@ import com.commafeed.frontend.model.request.IDRequest;
|
||||
import com.commafeed.frontend.model.request.MarkRequest;
|
||||
import com.commafeed.integration.BaseIT;
|
||||
|
||||
import jakarta.ws.rs.client.Entity;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
|
||||
class FeedIT extends BaseIT {
|
||||
|
||||
@Nested
|
||||
@@ -175,7 +175,7 @@ class FeedIT extends BaseIT {
|
||||
@Nested
|
||||
class Opml {
|
||||
@Test
|
||||
void importExportOpml() {
|
||||
void importExportOpml() throws IOException {
|
||||
importOpml();
|
||||
String opml = getClient().target(getApiBaseUrl() + "feed/export").request().get(String.class);
|
||||
String expextedOpml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<opml version=\"1.0\">\n" + " <head>\n"
|
||||
@@ -186,14 +186,16 @@ class FeedIT extends BaseIT {
|
||||
Assertions.assertEquals(StringUtils.normalizeSpace(expextedOpml), StringUtils.normalizeSpace(opml));
|
||||
}
|
||||
|
||||
void importOpml() {
|
||||
void importOpml() throws IOException {
|
||||
InputStream stream = Objects.requireNonNull(getClass().getResourceAsStream("/opml/opml_v2.0.xml"));
|
||||
MultiPart multiPart = new MultiPart().bodyPart(new StreamDataBodyPart("file", stream));
|
||||
multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
try (MultiPart multiPart = new MultiPart()) {
|
||||
multiPart.bodyPart(new StreamDataBodyPart("file", stream));
|
||||
multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
|
||||
getClient().target(getApiBaseUrl() + "feed/import")
|
||||
.request()
|
||||
.post(Entity.entity(multiPart, multiPart.getMediaType()), Void.TYPE);
|
||||
getClient().target(getApiBaseUrl() + "feed/import")
|
||||
.request()
|
||||
.post(Entity.entity(multiPart, multiPart.getMediaType()), Void.TYPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.commafeed.integration.rest;
|
||||
|
||||
import javax.ws.rs.client.Entity;
|
||||
import javax.ws.rs.core.Form;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -13,6 +10,9 @@ import com.commafeed.frontend.model.request.ProfileModificationRequest;
|
||||
import com.commafeed.frontend.resource.fever.FeverResponse;
|
||||
import com.commafeed.integration.BaseIT;
|
||||
|
||||
import jakarta.ws.rs.client.Entity;
|
||||
import jakarta.ws.rs.core.Form;
|
||||
|
||||
class FeverIT extends BaseIT {
|
||||
|
||||
private Long userId;
|
||||
|
||||
Reference in New Issue
Block a user