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

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

Introduction

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

Prototype

public void init() 

Source Link

Usage

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();

    verifyStatic(ClassUtils.class);
    ClassUtils.forName(eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    verifyZeroInteractions(logger);//  w  ww.ja v  a  2  s.c om
}