static boolean subjectMatch(Subscription subscription, Reason.Subject reasonSubject) {
        Assert.notNull(subscription, "The subscription must not be null");
        Assert.notNull(reasonSubject, "The reasonSubject must not be null");
        final var sourceSubject = subscription.getSpec().getReason().getSubject();

        var matchSubject = new Subscription.ReasonSubject();
        matchSubject.setKind(reasonSubject.getKind());
        matchSubject.setApiVersion(reasonSubject.getApiVersion());

        if (StringUtils.isBlank(sourceSubject.getName())) {
            return sourceSubject.equals(matchSubject);
        }
        matchSubject.setName(reasonSubject.getName());
        return sourceSubject.equals(matchSubject);
    }
@Test
    void subjectMatchTest() {
        var subscriber = new Subscription.Subscriber();
        subscriber.setName("test");

        final var subscription = createSubscription(subscriber);

        // match all name subscription
        var subject = new Reason.Subject();
        subject.setApiVersion("content.halo.run/v1alpha1");
        subject.setKind("Post");
        subject.setName("fake-post");
        assertThat(RecipientResolverImpl.subjectMatch(subscription, subject)).isTrue();

        // different kind
        subject = new Reason.Subject();
        subject.setApiVersion("content.halo.run/v1alpha1");
        subject.setKind("SinglePage");
        subject.setName("fake-post");
        assertThat(RecipientResolverImpl.subjectMatch(subscription, subject)).isFalse();

        // special case
        subscription.getSpec().getReason().getSubject().setName("other-post");
        subject = new Reason.Subject();
        subject.setApiVersion("content.halo.run/v1alpha1");
        subject.setKind("Post");
        subject.setName("fake-post");
        assertThat(RecipientResolverImpl.subjectMatch(subscription, subject)).isFalse();
        subject.setName("other-post");
        assertThat(RecipientResolverImpl.subjectMatch(subscription, subject)).isTrue();
    }