Add WebSocketInterceptor
See gh-162
This commit is contained in:
@@ -36,7 +36,7 @@ public class QueryTests {
|
||||
@BeforeEach
|
||||
public void setUp(@Autowired WebGraphQlHandler handler) {
|
||||
this.graphQlTester = WebGraphQlTester.create(webInput ->
|
||||
handler.handle(webInput).contextWrite(context -> context.put("name", "James")));
|
||||
handler.handleRequest(webInput).contextWrite(context -> context.put("name", "James")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SubscriptionTests {
|
||||
@BeforeEach
|
||||
public void setUp(@Autowired WebGraphQlHandler handler) {
|
||||
this.graphQlTester = WebGraphQlTester.create(webInput ->
|
||||
handler.handle(webInput).contextWrite(context -> context.put("name", "James")));
|
||||
handler.handleRequest(webInput).contextWrite(context -> context.put("name", "James")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -34,9 +34,9 @@ public class SampleApplication {
|
||||
|
||||
@Bean
|
||||
public WebInterceptor interceptor() {
|
||||
return (input, next) -> {
|
||||
return (webInput, interceptorChain) -> {
|
||||
// Switch threads to prove ThreadLocal context propagation works
|
||||
return Mono.delay(Duration.ofMillis(10)).flatMap(aLong -> next.handle(input));
|
||||
return Mono.delay(Duration.ofMillis(10)).flatMap(aLong -> interceptorChain.next(webInput));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user