Commit e7f80d3a authored by Alex Segers's avatar Alex Segers

[AFP-91] 🐛 Fix dependency injection error in `AnnotationConfig` (@asegers)

parent 26bec4c7
Pipeline #1729 failed with stage
in 38 seconds
...@@ -2,27 +2,21 @@ package com.afp.ordermanagement.config; ...@@ -2,27 +2,21 @@ package com.afp.ordermanagement.config;
import com.afp.ordermanagement.annotation.AccessTokenResolver; import com.afp.ordermanagement.annotation.AccessTokenResolver;
import com.afp.ordermanagement.annotation.ManagerPayloadResolver; import com.afp.ordermanagement.annotation.ManagerPayloadResolver;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer; import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer; import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer;
@Configuration @Configuration
//@ConditionalOnClass(EnableWebFlux.class) // checks that WebFlux is on the classpath
//@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
//@EnableWebFlux
public class AnnotationConfig implements WebFluxConfigurer { public class AnnotationConfig implements WebFluxConfigurer {
@Override @Override
public void configureArgumentResolvers(ArgumentResolverConfigurer configurer) { public void configureArgumentResolvers(ArgumentResolverConfigurer config) {
configurer.addCustomResolver(accessTokenResolver()); config.addCustomResolver(accessTokenResolve());
configurer.addCustomResolver(managerPayloadResolver()); config.addCustomResolver(managerPayloadResolver());
} }
@Bean @Bean
public AccessTokenResolver accessTokenResolver() { public AccessTokenResolver accessTokenResolve() {
return new AccessTokenResolver(); return new AccessTokenResolver();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment