Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
<cxf.httpcomponents.client.version>4.5.14</cxf.httpcomponents.client.version>
<cxf.httpcomponents.core.version.range>[4.3,4.5.0)</cxf.httpcomponents.core.version.range>
<cxf.httpcomponents.core.version>4.4.16</cxf.httpcomponents.core.version>
<cxf.httpcomponents.client5.version>5.5.1</cxf.httpcomponents.client5.version>
<cxf.httpcomponents.core5.version>5.3.6</cxf.httpcomponents.core5.version>
<cxf.httpcomponents.client5.version>5.6</cxf.httpcomponents.client5.version>
<cxf.httpcomponents.core5.version>5.4</cxf.httpcomponents.core5.version>
<cxf.jackson.version>3.0.3</cxf.jackson.version>
<cxf.jackson.databind.version>3.0.3</cxf.jackson.databind.version>
<cxf.jackson.annotations.version>2.20</cxf.jackson.annotations.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.List;

import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.Produces;
Expand All @@ -39,14 +40,18 @@
import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
import org.apache.cxf.jaxrs.provider.StreamingResponseProvider;
import org.apache.cxf.testutil.common.AbstractServerTestServerBase;
import org.apache.cxf.transport.common.gzip.GZIPFeature;
import tools.jackson.jakarta.rs.json.JacksonJsonProvider;

public class BookServerAsyncClient extends AbstractServerTestServerBase {
public static final String PORT = allocatePort(BookServerAsyncClient.class);

@Override
protected Server createServer(Bus bus) throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
final GZIPFeature gzipFeature = new GZIPFeature();
gzipFeature.setThreshold(1);

final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
sf.setResourceProvider(BookStore.class,
new SingletonResourceProvider(new BookStore(), true));
Expand All @@ -55,6 +60,7 @@ protected Server createServer(Bus bus) throws Exception {
sf.setProvider(new JacksonJsonProvider());
sf.setProvider(new StreamingResponseProvider<Book>());
sf.getProperties(true).put("default.content.type", "*/*");
sf.setFeatures(List.of(gzipFeature));
return sf.create();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import jakarta.ws.rs.core.Response.Status;
import jakarta.ws.rs.core.StreamingOutput;
import jakarta.ws.rs.core.UriInfo;
import org.apache.cxf.annotations.GZIP;
import org.apache.cxf.jaxrs.ext.MessageContext;
import org.apache.cxf.jaxrs.ext.Oneway;
import org.apache.cxf.jaxrs.ext.PATCH;
Expand All @@ -51,7 +50,6 @@
import org.apache.cxf.phase.PhaseInterceptorChain;

@Path("/bookstore")
@GZIP(threshold = 1)
public class BookStore {

private Map<Long, Book> books = new HashMap<>();
Expand Down
Loading