public String getUnsubscribeUrl(Subscription subscription) {
        var name = subscription.getMetadata().getName();
        var token = subscription.getSpec().getUnsubscribeToken();
        var externalUrl = defaultIfNull(externalUrlSupplier.getRaw(), URI.create("/"));
        return UriComponentsBuilder.fromUriString(externalUrl.toString())
            .path(UNSUBSCRIBE_PATTERN)
            .queryParam("token", token)
            .build(name)
            .toString();
    }
@Test
    void getUnsubscribeUrlTest() throws MalformedURLException {
        when(externalUrlSupplier.getRaw()).thenReturn(URI.create("https://halo.run").toURL());
        var subscription = new Subscription();
        subscription.setMetadata(new Metadata());
        subscription.getMetadata().setName("fake-subscription");
        subscription.setSpec(new Subscription.Spec());
        subscription.getSpec().setUnsubscribeToken("fake-unsubscribe-token");

        var url = subscriptionRouter.getUnsubscribeUrl(subscription);
        assertThat(url).isEqualTo("https://halo.run/apis/api.notification.halo.run/v1alpha1"
            + "/subscriptions/fake-subscription/unsubscribe"
            + "?token=fake-unsubscribe-token");
    }