Search in sources :

Example 1 with SpringSecurityWebProcessingContextBuilder

use of org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder in project thymeleaf-tests by thymeleaf.

the class SpringSecurityTest method testSpringSecurity.

@Test
public void testSpringSecurity() throws Exception {
    final SpringSecurityWebProcessingContextBuilder processingContextBuilder = new SpringSecurityWebProcessingContextBuilder();
    processingContextBuilder.setApplicationContextConfigLocation("classpath:templateengine/springsecurity/applicationContext-security.xml");
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setProcessingContextBuilder(processingContextBuilder);
    executor.setDialects(Arrays.asList(new IDialect[] { SpringSpecificVersionUtils.createSpringStandardDialectInstance(), new SpringSecurityDialect() }));
    executor.execute("classpath:templateengine/springsecurity");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) SpringSecurityDialect(org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect) SpringSecurityWebProcessingContextBuilder(org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Example 2 with SpringSecurityWebProcessingContextBuilder

use of org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder in project thymeleaf-tests by thymeleaf.

the class DataPrefixSpringSecurityTest method testSpringSecurity.

@Test
public void testSpringSecurity() throws Exception {
    final SpringSecurityWebProcessingContextBuilder processingContextBuilder = new SpringSecurityWebProcessingContextBuilder();
    processingContextBuilder.setApplicationContextConfigLocation("classpath:templateengine/dataprefix/springsecurity/applicationContext-security.xml");
    final TestExecutor executor = TestExecutorFactory.createTestExecutor();
    executor.setProcessingContextBuilder(processingContextBuilder);
    executor.setDialects(Arrays.asList(new IDialect[] { SpringSpecificVersionUtils.createSpringStandardDialectInstance(), new SpringSecurityDialect() }));
    executor.execute("classpath:templateengine/dataprefix/springsecurity");
    Assert.assertTrue(executor.isAllOK());
}
Also used : TestExecutor(org.thymeleaf.testing.templateengine.engine.TestExecutor) SpringSecurityDialect(org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect) SpringSecurityWebProcessingContextBuilder(org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder) IDialect(org.thymeleaf.dialect.IDialect) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 IDialect (org.thymeleaf.dialect.IDialect)2 SpringSecurityDialect (org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect)2 SpringSecurityWebProcessingContextBuilder (org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder)2 TestExecutor (org.thymeleaf.testing.templateengine.engine.TestExecutor)2