Examples of WhiteListedAllowFromStrategy


Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

*/
public class WhiteListedAllowFromStrategyTests {

    @Test(expected = IllegalArgumentException.class)
    public void emptyListShouldThrowException() {
        new WhiteListedAllowFromStrategy(new ArrayList<String>());
    }
View Full Code Here

Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

        new WhiteListedAllowFromStrategy(new ArrayList<String>());
    }

    @Test(expected = IllegalArgumentException.class)
    public void nullListShouldThrowException() {
        new WhiteListedAllowFromStrategy(null);
    }
View Full Code Here

Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

    @Test
    public void listWithSingleElementShouldMatch() {
        List<String> allowed = new ArrayList<String>();
        allowed.add("http://www.test.com");
        WhiteListedAllowFromStrategy strategy = new WhiteListedAllowFromStrategy(allowed);
        strategy.setAllowFromParameterName("from");
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setParameter("from", "http://www.test.com");

        String result = strategy.getAllowFromValue(request);
        assertThat(result, is("http://www.test.com"));
    }
View Full Code Here

Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

    @Test
    public void listWithMultipleElementShouldMatch() {
        List<String> allowed = new ArrayList<String>();
        allowed.add("http://www.test.com");
        allowed.add("http://www.springsource.org");
        WhiteListedAllowFromStrategy strategy = new WhiteListedAllowFromStrategy(allowed);
        strategy.setAllowFromParameterName("from");
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setParameter("from", "http://www.test.com");

        String result = strategy.getAllowFromValue(request);
        assertThat(result, is("http://www.test.com"));
    }
View Full Code Here

Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

    @Test
    public void listWithSingleElementShouldNotMatch() {
        List<String> allowed = new ArrayList<String>();
        allowed.add("http://www.test.com");
        WhiteListedAllowFromStrategy strategy = new WhiteListedAllowFromStrategy(allowed);
        strategy.setAllowFromParameterName("from");
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setParameter("from", "http://www.test123.com");

        String result = strategy.getAllowFromValue(request);
        assertThat(result, is("DENY"));
    }
View Full Code Here

Examples of org.springframework.security.web.header.writers.frameoptions.WhiteListedAllowFromStrategy

    @Test
    public void requestWithoutParameterShouldNotMatch() {
        List<String> allowed = new ArrayList<String>();
        allowed.add("http://www.test.com");
        WhiteListedAllowFromStrategy strategy = new WhiteListedAllowFromStrategy(allowed);
        strategy.setAllowFromParameterName("from");
        MockHttpServletRequest request = new MockHttpServletRequest();

        String result = strategy.getAllowFromValue(request);
        assertThat(result, is("DENY"));

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.