Skip to content

Commit 6f1a4dc

Browse files
A minimal test (failing) to show that a Netty buffer is not accessible outside a Netty thread (related to #731)
1 parent 1ef2c40 commit 6f1a4dc

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.jooby.issues;
2+
3+
import org.jooby.test.ServerFeature;
4+
import org.junit.Test;
5+
6+
import java.util.concurrent.Executors;
7+
8+
public class Issue731 extends ServerFeature {
9+
10+
{
11+
12+
executor("worker1", Executors.newSingleThreadExecutor());
13+
14+
post("/", deferred("worker1", req -> req.body(String.class)));
15+
16+
}
17+
18+
@Test
19+
public void appShouldBeAbleToReadTheRequestBodyWhenDeferred() throws Exception {
20+
request()
21+
.post("/")
22+
.body("HelloWorld!", "text/plain")
23+
.expect(200)
24+
.expect("HelloWorld!");
25+
}
26+
}

0 commit comments

Comments
 (0)