@Override
    public Mono<ServerResponse> handle(ServerRequest request) {
        var name = request.pathVariable("name");
        return client.get(scheme.type(), name)
            .flatMap(client::delete)
            .flatMap(deleted -> ServerResponse
                .ok()
                .contentType(MediaType.APPLICATION_JSON)
                .bodyValue(deleted));
    }
@Test
    void shouldHandleCorrectly() {
        final var fake = new FakeExtension();
        var metadata = new Metadata();
        metadata.setName("my-fake");
        fake.setMetadata(metadata);

        var unstructured = new Unstructured();
        unstructured.setMetadata(metadata);
        unstructured.setApiVersion("fake.halo.run/v1alpha1");
        unstructured.setKind("Fake");

        var serverRequest = MockServerRequest.builder()
            .pathVariable("name", "my-fake")
            .body(Mono.just(unstructured));
        when(client.get(eq(FakeExtension.class), eq("my-fake"))).thenReturn(Mono.just(fake));
        when(client.delete(eq(fake))).thenReturn(Mono.just(fake));

        var scheme = Scheme.buildFromType(FakeExtension.class);
        var deleteHandler = new ExtensionDeleteHandler(scheme, client);
        var responseMono = deleteHandler.handle(serverRequest);

        StepVerifier.create(responseMono)
            .assertNext(response -> {
                assertEquals(HttpStatus.OK, response.statusCode());
                assertEquals(MediaType.APPLICATION_JSON, response.headers().getContentType());
                assertTrue(response instanceof EntityResponse<?>);
                assertEquals(fake, ((EntityResponse<?>) response).entity());
            })
            .verifyComplete();
        verify(client, times(1)).get(eq(FakeExtension.class), eq("my-fake"));
        verify(client, times(1)).delete(any());
        verify(client, times(0)).update(any());
    }