@Override
    @NonNull
    public Mono<ServerResponse> handle(@NonNull ServerRequest request) {
        return request.bodyToMono(Unstructured.class)
            .switchIfEmpty(Mono.error(() -> new ExtensionConvertException(
                "Cannot read body to " + scheme.groupVersionKind())))
            .flatMap(client::create)
            .flatMap(createdExt -> ServerResponse
                .created(URI.create(pathPattern() + "/" + createdExt.getMetadata().getName()))
                .contentType(MediaType.APPLICATION_JSON)
                .bodyValue(createdExt));
    }
@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()
            .body(Mono.just(unstructured));
        when(client.create(any(Unstructured.class))).thenReturn(Mono.just(unstructured));

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

        StepVerifier.create(responseMono)
            .consumeNextWith(response -> {
                assertEquals(HttpStatus.CREATED, response.statusCode());
                assertEquals("/apis/fake.halo.run/v1alpha1/fakes/my-fake",
                    Objects.requireNonNull(response.headers().getLocation()).toString());
                assertEquals(MediaType.APPLICATION_JSON, response.headers().getContentType());
                assertTrue(response instanceof EntityResponse<?>);
                assertEquals(unstructured, ((EntityResponse<?>) response).entity());
            })
            .verifyComplete();
        verify(client, times(1)).create(eq(unstructured));
    }