@Override
    public String permalink(Post post) {
        Map<String, String> annotations = MetadataUtil.nullSafeAnnotations(post);
        String permalinkPattern =
            annotations.getOrDefault(Constant.PERMALINK_PATTERN_ANNO, DEFAULT_PERMALINK_PATTERN);
        return createPermalink(post, permalinkPattern);
    }
@Test
    void permalinkWithExternalUrl() {
        Post post = TestPost.postV1();
        Map<String, String> annotations = MetadataUtil.nullSafeAnnotations(post);
        annotations.put(Constant.PERMALINK_PATTERN_ANNO, "/{year}/{month}/{day}/{slug}");
        post.getMetadata().setName("test-post");
        post.getSpec().setSlug("test-post-slug");
        Instant now = Instant.parse("2022-11-01T02:40:06.806310Z");
        post.getSpec().setPublishTime(now);

        when(externalUrlSupplier.get()).thenReturn(URI.create("http://example.com"));

        String permalink = postPermalinkPolicy.permalink(post);
        assertThat(permalink).isEqualTo("http://example.com/2022/11/01/test-post-slug");

        post.getSpec().setSlug("中文 slug");
        permalink = postPermalinkPolicy.permalink(post);
        assertThat(permalink).isEqualTo("http://example.com/2022/11/01/%E4%B8%AD%E6%96%87%20slug");
    }