title: RouterFunction not able to inject handler bean
body: <p>I've set up a temporary github project to troubleshoot a hobby project to learn reactive java. <a href="https://github.com/mikepc/mongodb-reactive-tmp" rel="nofollow noreferrer">https://github.com/mikepc/mongodb-reactive-tmp</a></p>
  
  <p>My biggest problem is getting the router to configure properly.</p>
  
  <p>Router:</p>
  
  <pre><code>@Configuration
  public class SponsoredEventRouter {
  
  
      @Bean
      public RouterFunction&lt;ServerResponse&gt; route(SponsoredEventHandler handler){
  
          return RouterFunctions
                  .route(POST("/events").and(accept(MediaType.APPLICATION_JSON)), handler::createSponsoredEvent);
      }
  
  }
  </code></pre>
  
  <p>Handler:</p>
  
  <pre><code>@Slf4j
  @Component
  
  public class SponsoredEventHandler {
      private final SponsoredEventService sponsoredEventService;
  
      public SponsoredEventHandler(SponsoredEventService sponsoredEventService) {
          this.sponsoredEventService = sponsoredEventService;
      }
  
      public Mono&lt;ServerResponse&gt; createSponsoredEvent(ServerRequest req) {
          Mono&lt;SponsoredEventRequest&gt; newEventRequest = req.bodyToMono(SponsoredEventRequest.class);
  
          return ok()
                  .contentType(MediaType.APPLICATION_JSON)
                  .body(this.sponsoredEventService.createSponsoredEvent(newEventRequest), SponsoredEvent.class);
  
  
      }
  }
  </code></pre>
  
  <p>The POM is in the project</p>
  
  <p>Problems are the following:
  1) IDEA is showing a red squiggly saying "Could not autowire. No beans of type 'SponsoredEventHandler' could be found." 
  2) The route is not being registered. When I hit the /events endpoint, it returns a basic 404 error.</p>