Example usage for io.netty.channel ChannelPromise setSuccess

List of usage examples for io.netty.channel ChannelPromise setSuccess

Introduction

In this page you can find the example usage for io.netty.channel ChannelPromise setSuccess.

Prototype

@Override
    ChannelPromise setSuccess(Void result);

Source Link

Usage

From source file:com.linecorp.armeria.common.RequestContextTest.java

License:Apache License

@Test
@SuppressWarnings("deprecation")
public void makeContextAwareChannelFutureListener() {
    RequestContext context = createContext();
    ChannelPromise promise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
    promise.addListener(context.makeContextAware((ChannelFutureListener) f -> {
        assertEquals(context, RequestContext.current());
        assertTrue(entered.get());//from   w  w w . j av a2 s.  c  o m
    }));
    promise.setSuccess(null);
}