-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for "method not registered" error in native mode
Described here: quarkusio/quarkus#44564 quarkusio/quarkus#44613 https://issues.redhat.com/browse/QQE-1234
- Loading branch information
Showing
4 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...um-reactive/src/main/java/io/quarkus/ts/http/minimum/reactive/JakartaRestInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.quarkus.ts.http.minimum.reactive; | ||
|
||
import java.io.IOException; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.ws.rs.WebApplicationException; | ||
import jakarta.ws.rs.ext.Provider; | ||
import jakarta.ws.rs.ext.ReaderInterceptor; | ||
import jakarta.ws.rs.ext.ReaderInterceptorContext; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
@Provider | ||
@ApplicationScoped | ||
public class JakartaRestInterceptor implements ReaderInterceptor { | ||
|
||
private static final Logger LOG = Logger.getLogger(JakartaRestInterceptor.class); | ||
|
||
@Override | ||
public Object aroundReadFrom(ReaderInterceptorContext context) | ||
throws IOException, WebApplicationException { | ||
LOG.info("Before reading " + context.getGenericType()); | ||
Object entity = context.proceed(); | ||
LOG.info("After reading " + entity); | ||
return entity; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
http/http-minimum-reactive/src/main/java/io/quarkus/ts/http/minimum/reactive/Operator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
package io.quarkus.ts.http.minimum.reactive; | ||
|
||
public class Operator { | ||
private String name; | ||
|
||
public Operator() { | ||
this.name = null; | ||
} | ||
|
||
public Operator(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...-minimum-reactive/src/main/java/io/quarkus/ts/http/minimum/reactive/OperatorResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.ts.http.minimum.reactive; | ||
|
||
import jakarta.interceptor.Interceptors; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
|
||
@Path("/operator") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
@Interceptors({ JakartaRestInterceptor.class }) | ||
public class OperatorResource { | ||
|
||
@POST | ||
public Uni<Response> postOperator(Operator operator) { | ||
return Uni.createFrom().item(Response.status(Response.Status.OK) | ||
.entity("Hello " + operator.getName()).build()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters