Class ThymeleafWithHttpResourceProtocolResolverIT


  • @SpringBootTest({"juplo.http-resources.protocol-resolver.enabled=true","spring.thymeleaf.cache=true"})
    public class ThymeleafWithHttpResourceProtocolResolverIT
    extends IntegrationTestBase
    This test-case showcases the usage of the HttpResourceProtocolResolver with Thymeleaf. Since Thymeleaf does not use the Resource-Chain mechanism, that Spring introduced for the handling of static resources, the HttpResourceProtocolResolver has to be used and the protocol has to be hardwired into the configuration as spring.thymeleaf.prefix. The downside of this approach is, that the templates are only resolved against the configured remote-URI and do not take part in the fallback-mechanism, that can be configured through spring.resources.static-locations. The test-case was addapted accordingly, to show the changed behaviour.
    • Constructor Detail

      • ThymeleafWithHttpResourceProtocolResolverIT

        public ThymeleafWithHttpResourceProtocolResolverIT()
    • Method Detail

      • setUp

        @BeforeEach
        public void setUp()
      • testRenderLocalTemplate

        @Test
        public void testRenderLocalTemplate()
                                     throws Exception
        Throws:
        Exception
      • testRenderRemoteTemplate

        @Test
        public void testRenderRemoteTemplate()
                                      throws Exception
        Throws:
        Exception
      • testRenderCachedRemoteTemplate

        @Test
        public void testRenderCachedRemoteTemplate()
                                            throws Exception
        Throws:
        Exception
      • testRenderModifiedRemoteTemplate

        @Test
        public void testRenderModifiedRemoteTemplate()
                                              throws Exception
        Throws:
        Exception