@Override
    protected String processLink(IExpressionContext context, String link) {
        if (link == null || !linkInSite(externalUrlSupplier.get(), link)) {
            return link;
        }

        if (StringUtils.isBlank(link)) {
            link = "/";
        }

        if (isAssetsRequest(link)) {
            return PathUtils.combinePath(THEME_PREVIEW_PREFIX, theme.getName(), link);
        }

        // not assets link
        if (theme.isActive()) {
            return link;
        }

        return UriComponentsBuilder.fromUriString(link)
            .queryParam(ThemeContext.THEME_PREVIEW_PARAM_NAME, theme.getName())
            .build().toString();
    }
@Test
    void processAssetsLink() {
        // activated theme
        ThemeLinkBuilder themeLinkBuilder =
            new ThemeLinkBuilder(getTheme(true), externalUrlSupplier);

        String link = "/assets/css/style.css";
        String processed = themeLinkBuilder.processLink(null, link);
        assertThat(processed).isEqualTo("/themes/test-theme/assets/css/style.css");

        // preview theme
        getTheme(false);
        link = "/assets/js/main.js";
        processed = themeLinkBuilder.processLink(null, link);
        assertThat(processed).isEqualTo("/themes/test-theme/assets/js/main.js");
    }