@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 shouldReturnErrorWhenExtensionNotFound() {
        var serverRequest = MockServerRequest.builder()
            .pathVariable("name", "my-fake")
            .build();
        when(client.get(FakeExtension.class, "my-fake")).thenReturn(
            Mono.error(
                new ExtensionNotFoundException(fromExtension(FakeExtension.class), "my-fake")));

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

        StepVerifier.create(responseMono)
            .verifyError(ExtensionNotFoundException.class);

        verify(client, times(1)).get(same(FakeExtension.class), anyString());
        verify(client, times(0)).update(any());
        verify(client, times(0)).delete(any());
    }