Search in sources :

Example 1 with SpringSecurityDialect

use of org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect 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 SpringSecurityDialect

use of org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect in project irida by phac-nml.

the class IridaUIWebConfig method additionalDialects.

/**
 * This is to add additional Thymeleaf dialects.
 *
 * @return A Set of Thymeleaf dialects.
 */
private Set<IDialect> additionalDialects() {
    Set<IDialect> dialects = new HashSet<>();
    dialects.add(new SpringSecurityDialect());
    dialects.add(new LayoutDialect());
    dialects.add(new DataAttributeDialect());
    return dialects;
}
Also used : DataAttributeDialect(com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect) SpringSecurityDialect(org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect) IDialect(org.thymeleaf.dialect.IDialect) HashSet(java.util.HashSet) LayoutDialect(nz.net.ultraq.thymeleaf.LayoutDialect)

Example 3 with SpringSecurityDialect

use of org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect 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

IDialect (org.thymeleaf.dialect.IDialect)3 SpringSecurityDialect (org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect)3 Test (org.junit.Test)2 SpringSecurityWebProcessingContextBuilder (org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder)2 TestExecutor (org.thymeleaf.testing.templateengine.engine.TestExecutor)2 DataAttributeDialect (com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect)1 HashSet (java.util.HashSet)1 LayoutDialect (nz.net.ultraq.thymeleaf.LayoutDialect)1