Skip to content

Commit

Permalink
Alter ChunkedResponseTest to expose the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Oct 6, 2022
1 parent a80df09 commit fd7beb6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ public void transform(TransformationContext context) {
ClassInfo clazz = context.getTarget().asClass();
// only adding to Path, since adding it to Provider doesn't seem necessary and in fact
// causes other failures
if (clazz.declaredAnnotation(ResteasyReactiveDotNames.PATH) != null
if ((clazz.declaredAnnotation(ResteasyReactiveDotNames.PATH) != null
|| clazz.declaredAnnotation(ResteasyReactiveDotNames.PROVIDER) != null)
&& clazz.declaredAnnotation(ResteasyReactiveDotNames.TYPED) == null) {
// Add @Typed(MyResource.class)
context.transform().add(createTypedAnnotationInstance(clazz)).done();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,22 @@ public String helloSmall() {
}

@Provider
public static final class CustomStringMessageBodyWriter extends ServerStringMessageBodyHandler {
public static class CustomStringMessageBodyWriter extends ServerStringMessageBodyHandler {

@Override
public void writeResponse(Object o, Type genericType, ServerRequestContext context)
throws WebApplicationException {

try (OutputStream stream = context.getOrCreateOutputStream()) {
stream.write(((String) o).getBytes());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}

@Provider
public static final class CustomStringMessageBodyWriter2 extends CustomStringMessageBodyWriter {

@Override
public void writeResponse(Object o, Type genericType, ServerRequestContext context)
Expand Down

0 comments on commit fd7beb6

Please sign in to comment.