    @Test
    public void deleteSubscription() throws Exception {

        final String subscriptionId = "subscriptionId";
        final String pushResourceId = "pushResourceId";
        final ChannelHandlerContext ctx = mockChannelHandlerContext(subscriptionId);
        final Http2ConnectionEncoder encoder = mockEncoder(w -> w.thenReturn(pushPath(pushResourceId))
                .thenReturn(pushPath(pushResourceId)), Resource.PUSH);
        final WebPushFrameListener frameListener = new WebPushFrameListener(MockWebPushServerBuilder
                .withSubscription(new DefaultSubscription(subscriptionId, pushResourceId))
                .nonexistentPushResourceToken(pushResourceId)
                .build(), encoder);
        try {
            final Http2Headers subscribeHeaders = UserAgent.subscribe(frameListener, ctx, encoder);
            UserAgent.receivePushMessages(frameListener, ctx, subscribeHeaders);
            final Http2Headers deleteSubscriptionHeaders = UserAgent.deleteSubscription(frameListener, ctx,
                    subscribeHeaders, encoder);
            assertThat(deleteSubscriptionHeaders.status(), equalTo(NO_CONTENT.codeAsText()));
            final Http2Headers goneHeaders = captureStreamHeaders(encoder);
            assertThat(goneHeaders.status(), equalTo(GONE.codeAsText()));
            final ByteBuf payload = copiedBuffer("payload", UTF_8);
            final Http2Headers headers = AppServer.sendPush(frameListener, ctx, encoder, subscribeHeaders, payload);
            assertThat(headers.status(), equalTo(NOT_FOUND.codeAsText()));
        } finally {
            frameListener.shutdown();
        }
    }