Example usage for org.springframework.security.config SecurityNamespaceHandler SecurityNamespaceHandler

List of usage examples for org.springframework.security.config SecurityNamespaceHandler SecurityNamespaceHandler

Introduction

In this page you can find the example usage for org.springframework.security.config SecurityNamespaceHandler SecurityNamespaceHandler.

Prototype

public SecurityNamespaceHandler() 

Source Link

Usage

From source file:org.springframework.security.config.SecurityNamespaceHandlerTests.java

@Test
public void constructionSucceeds() {
    new SecurityNamespaceHandler();
    // Shameless class coverage stats boosting
    new BeanIds() {
    };/*w w w  .  j a v a 2 s.co  m*/
    new Elements() {
    };
}

From source file:org.springframework.security.config.SecurityNamespaceHandlerTests.java

@Test
public void initDoesNotLogErrorWhenFilterChainProxyFailsToLoad() throws Exception {
    String className = "javax.servlet.Filter";
    spy(ClassUtils.class);
    doThrow(new NoClassDefFoundError(className)).when(ClassUtils.class, "forName",
            eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));

    Log logger = mock(Log.class);
    SecurityNamespaceHandler handler = new SecurityNamespaceHandler();
    ReflectionTestUtils.setField(handler, "logger", logger);

    handler.init();//from w  w w.  j  a  va 2 s.c o  m

    verifyStatic(ClassUtils.class);
    ClassUtils.forName(eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    verifyZeroInteractions(logger);
}