Skip to content

Commit

Permalink
Double-checked that the StreamingTest behaves as expected with curren…
Browse files Browse the repository at this point in the history
…t JettyConnector implementation.
  • Loading branch information
daijithegeek committed Aug 18, 2022
1 parent 28b53de commit 2711ad0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

public class StreamingTest extends JerseyTest {
private static final Logger LOGGER = Logger.getLogger(StreamingTest.class.getName());
public static final String FIELD_CONTENT = "a field";

@Path("/test")
public static class StreamingResource {
Expand All @@ -79,7 +80,7 @@ public Response streamsWithDelay(@QueryParam("start") @DefaultValue("0") int sta
@Produces(MediaType.APPLICATION_JSON)
@Path("json")
public AnObject json() {
return new AnObject("a field", 42);
return new AnObject(FIELD_CONTENT, 42);
}
}

Expand Down Expand Up @@ -176,7 +177,7 @@ public void testJettyThreadShouldNotDeadlock() throws Exception {
.get(AnObject.class)
.get();

assertThat("Listening the stream for bytes starts after headers are received", result, equalTo("blabla"));
assertThat( result.getaField(), equalTo(FIELD_CONTENT));
}

private StreamingStatistics computeOutputStatistics(Supplier<InputStream> stream, long httpCallStart) throws IOException {
Expand Down Expand Up @@ -225,6 +226,10 @@ public static class AnObject {
private String aField;
private int anotherField;

public AnObject() {
//empty constructor for jackson
}

public AnObject(String aField, int anotherField) {
this.aField = aField;
this.anotherField = anotherField;
Expand Down

0 comments on commit 2711ad0

Please sign in to comment.