@Override
    public Result reconcile(Request request) {
        return client.fetch(ReverseProxy.class, request.name())
            .map(reverseProxy -> {
                if (isDeleted(reverseProxy)) {
                    cleanUpResourcesAndRemoveFinalizer(request.name());
                    return new Result(false, null);
                }
                addFinalizerIfNecessary(reverseProxy);
                registerReverseProxy(reverseProxy);
                return new Result(false, null);
            })
            .orElse(new Result(false, null));
    }
@Test
    void reconcileRemoval() {
        // fix gh-2937
        ReverseProxy reverseProxy = new ReverseProxy();
        reverseProxy.setMetadata(new Metadata());
        reverseProxy.getMetadata().setName("fake-reverse-proxy");
        reverseProxy.getMetadata().setDeletionTimestamp(Instant.now());
        reverseProxy.getMetadata()
            .setLabels(Map.of(PluginConst.PLUGIN_NAME_LABEL_NAME, "fake-plugin"));
        reverseProxy.setRules(List.of());

        doNothing().when(routerFunctionRegistry).remove(anyString(), anyString());
        when(client.fetch(ReverseProxy.class, "fake-reverse-proxy"))
            .thenReturn(Optional.of(reverseProxy));

        reverseProxyReconciler.reconcile(new Reconciler.Request("fake-reverse-proxy"));

        verify(routerFunctionRegistry, never()).register(anyString(), any(ReverseProxy.class));

        verify(routerFunctionRegistry, times(1))
            .remove(eq("fake-plugin"), eq("fake-reverse-proxy"));
    }