congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ObjectPostProcessor.postProcess
Code IndexAdd Tabnine to your IDE (free)

How to use
postProcess
method
in
org.springframework.security.config.annotation.ObjectPostProcessor

Best Java code snippets using org.springframework.security.config.annotation.ObjectPostProcessor.postProcess (Showing top 20 results out of 315)

origin: spring-projects/spring-security

/**
 * Performs post processing of an object. The default is to delegate to the
 * {@link ObjectPostProcessor}.
 *
 * @param object the Object to post process
 * @return the possibly modified Object to use
 */
protected <P> P postProcess(P object) {
  return this.objectPostProcessor.postProcess(object);
}
origin: spring-projects/spring-security

@Autowired(required = false)
public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
  this.objectPostProcessor = objectPostProcessor;
  this.defaultMethodExpressionHandler = objectPostProcessor
      .postProcess(defaultMethodExpressionHandler);
}
origin: spring-projects/spring-security

@Autowired(required = false)
public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
  defaultExpressionHandler = objectPostProcessor.postProcess(defaultExpressionHandler);
}
origin: spring-projects/spring-security

@SuppressWarnings({ "rawtypes", "unchecked" })
public Object postProcess(Object object) {
  for (ObjectPostProcessor opp : postProcessors) {
    Class<?> oppClass = opp.getClass();
    Class<?> oppType = GenericTypeResolver.resolveTypeArgument(oppClass,
        ObjectPostProcessor.class);
    if (oppType == null || oppType.isAssignableFrom(object.getClass())) {
      object = opp.postProcess(object);
    }
  }
  return object;
}
origin: spring-projects/spring-security

  @Autowired
  public void configure(ObjectPostProcessor<Object> p) {
    p.postProcess(this.toTest);
  }
}
origin: spring-projects/spring-security

/**
 * Creates the Spring Security Filter Chain
 * @return the {@link Filter} that represents the security filter chain
 * @throws Exception
 */
@Bean(name = AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME)
public Filter springSecurityFilterChain() throws Exception {
  boolean hasConfigurers = webSecurityConfigurers != null
      && !webSecurityConfigurers.isEmpty();
  if (!hasConfigurers) {
    WebSecurityConfigurerAdapter adapter = objectObjectPostProcessor
        .postProcess(new WebSecurityConfigurerAdapter() {
        });
    webSecurity.apply(adapter);
  }
  return webSecurity.build();
}
origin: spring-projects/spring-security

  @Autowired
  public void configure(ObjectPostProcessor<Object> p) {
    p.postProcess(new Object());
  }
}
origin: spring-projects/spring-security

@Test
public void getAuthenticationManagerWhenPostProcessThenUsesBeanClassLoaderOnProxyFactoryBean() throws Exception {
  this.spring.register(Sec2531Config.class).autowire();
  ObjectPostProcessor<Object> opp = this.spring.getContext().getBean(ObjectPostProcessor.class);
  when(opp.postProcess(any())).thenAnswer(a -> a.getArgument(0));
  AuthenticationConfiguration config = this.spring.getContext().getBean(AuthenticationConfiguration.class);
  config.getAuthenticationManager();
  verify(opp).postProcess(any(ProxyFactoryBean.class));
}
origin: spring-projects/spring-security

@Test
public void configureWhenRegisteringObjectPostProcessorThenInvokedOnExceptionTranslationFilter() {
  this.spring.register(ObjectPostProcessorConfig.class, DefaultSecurityConfig.class).autowire();
  verify(ObjectPostProcessorConfig.objectPostProcessor)
      .postProcess(any(ExceptionTranslationFilter.class));
}
origin: spring-projects/spring-security

@Test
public void buildWhenAddAuthenticationProviderThenDoesNotPerformRegistration() throws Exception {
  ObjectPostProcessor<Object> opp = mock(ObjectPostProcessor.class);
  AuthenticationProvider provider = mock(AuthenticationProvider.class);
  AuthenticationManagerBuilder builder = new AuthenticationManagerBuilder(opp);
  builder.authenticationProvider(provider);
  builder.build();
  verify(opp, never()).postProcess(provider);
}
origin: spring-projects/spring-security

@Test
public void configureWhenRegisteringObjectPostProcessorThenInvokedOnExceptionTranslationFilter() {
  this.spring.register(ObjectPostProcessorConfig.class, DefaultSecurityConfig.class).autowire();
  verify(ObjectPostProcessorConfig.objectPostProcessor)
      .postProcess(any(RequestCacheAwareFilter.class));
}
origin: spring-projects/spring-security

@Test
public void customAuthenticationEventPublisherWithWeb() throws Exception {
  ObjectPostProcessor<Object> opp = mock(ObjectPostProcessor.class);
  AuthenticationEventPublisher aep = mock(AuthenticationEventPublisher.class);
  when(opp.postProcess(any())).thenAnswer(a -> a.getArgument(0));
  AuthenticationManager am = new AuthenticationManagerBuilder(opp)
        .authenticationEventPublisher(aep)
        .inMemoryAuthentication()
        .and()
        .build();
  try {
    am.authenticate(new UsernamePasswordAuthenticationToken("user", "password"));
  } catch (AuthenticationException success) {}
  verify(aep).publishAuthenticationFailure(any(), any());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenDisposableBeanThenAwareInvoked() throws Exception {
  this.spring.register(Config.class).autowire();
  DisposableBean toPostProcess = mock(DisposableBean.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  this.spring.getContext().close();
  verify(toPostProcess).destroy();
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenApplicationContextAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  ApplicationContextAware toPostProcess = mock(ApplicationContextAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setApplicationContext(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenBeanClassLoaderAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  BeanClassLoaderAware toPostProcess = mock(BeanClassLoaderAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setBeanClassLoader(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenBeanFactoryAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  BeanFactoryAware toPostProcess = mock(BeanFactoryAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setBeanFactory(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenEnvironmentAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  EnvironmentAware toPostProcess = mock(EnvironmentAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setEnvironment(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenApplicationEventPublisherAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  ApplicationEventPublisherAware toPostProcess = mock(ApplicationEventPublisherAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setApplicationEventPublisher(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenMessageSourceAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  MessageSourceAware toPostProcess = mock(MessageSourceAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setMessageSource(isNotNull());
}
origin: spring-projects/spring-security

@Test
public void postProcessWhenServletContextAwareThenAwareInvoked() {
  this.spring.register(Config.class).autowire();
  ServletContextAware toPostProcess = mock(ServletContextAware.class);
  this.objectObjectPostProcessor.postProcess(toPostProcess);
  verify(toPostProcess).setServletContext(isNotNull());
}
org.springframework.security.config.annotationObjectPostProcessorpostProcess

Javadoc

Initialize the object possibly returning a modified instance that should be used instead.

Popular methods of ObjectPostProcessor

    Popular in Java

    • Reactive rest calls using spring rest template
    • setContentView (Activity)
    • getApplicationContext (Context)
    • putExtra (Intent)
    • IOException (java.io)
      Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
    • RandomAccessFile (java.io)
      Allows reading from and writing to a file in a random-access manner. This is different from the uni-
    • GregorianCalendar (java.util)
      GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
    • SortedSet (java.util)
      SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
    • Stack (java.util)
      Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
    • IOUtils (org.apache.commons.io)
      General IO stream manipulation utilities. This class provides static utility methods for input/outpu
    • 21 Best IntelliJ Plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now