Package de.juplo.httpresources
Class ThymeleafWithHttpResourceProtocolResolverIT
- java.lang.Object
-
- de.juplo.httpresources.IntegrationTestBase
-
- de.juplo.httpresources.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 theHttpResourceProtocolResolver
with Thymeleaf. Since Thymeleaf does not use the Resource-Chain mechanism, that Spring introduced for the handling of static resources, theHttpResourceProtocolResolver
has to be used and the protocol has to be hardwired into the configuration asspring.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 throughspring.resources.static-locations
. The test-case was addapted accordingly, to show the changed behaviour.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThymeleafWithHttpResourceProtocolResolverIT.Application
static class
ThymeleafWithHttpResourceProtocolResolverIT.TestController
-
Nested classes/interfaces inherited from class de.juplo.httpresources.IntegrationTestBase
IntegrationTestBase.Callback, IntegrationTestBase.ClockStub, IntegrationTestBase.IntegrationTestConfiguration
-
-
Field Summary
-
Fields inherited from class de.juplo.httpresources.IntegrationTestBase
CLOCK, formatter, NGINX, server
-
-
Constructor Summary
Constructors Constructor Description ThymeleafWithHttpResourceProtocolResolverIT()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
testRenderCachedRemoteTemplate()
void
testRenderLocalTemplate()
void
testRenderModifiedRemoteTemplate()
void
testRenderRemoteTemplate()
-
Methods inherited from class de.juplo.httpresources.IntegrationTestBase
address, clearMockServer, FETCH, getMockServerPort, getMockServerUri, INTERNAL_SERVER_ERROR, NGINIX_IP, NGINX, NGINX, NGINX_PORT, NGINX_URI, NOT_FOUND, prepareMockServer, RESPONSE
-
-
-
-
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
-
-