title: Parameter 0 of constructor required a bean that could not be found
body: <p>I am not sure what is wrong with my codes. I was trying to learn Spring Boot WebFlux. But I am not able to run the application as i get the below error</p>
  
  <blockquote>
    <p>" Parameter 0 of constructor in com.thomsoncodes.todo.controller.ToDoController required a bean of type 'com.thomsoncodes.todo.repository.ToDoRespository' that could not be found."</p>
  </blockquote>
  
  <p>Tired @Autowired but still I have the same error.</p>
  
  <p>Here is my code</p>
  
  <p>build.gradle</p>
  
  <pre><code>plugins {
    id 'org.springframework.boot' version '2.1.3.RELEASE'
    id 'java'
  }
  
  apply plugin: 'io.spring.dependency-management'
  
  group = 'com.thomsoncodes.todo'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '1.8'
  
  repositories {
    mavenCentral()
  }
  
  dependencies {
     implementation 'org.springframework.boot:spring-boot-starter-webflux'
     compileOnly 'org.projectlombok:lombok'
     testImplementation 'org.springframework.boot:spring-boot-starter-test'
     testImplementation 'io.projectreactor:reactor-test'
  }
  </code></pre>
  
  <p>Application class</p>
  
  <pre><code>package com.thomsoncodes.todo;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class SpringBootTodoWebfluxApplication {
  
   public static void main(String[] args) {
      SpringApplication.run(SpringBootTodoWebfluxApplication.class, args);
   }
  
  }
  </code></pre>
  
  <p>Controller class</p>
  
  <pre><code>package com.thomsoncodes.todo.controller;
  
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.thomsoncodes.todo.domain.ToDo;
  import com.thomsoncodes.todo.repository.ToDoRespository;
  
  import reactor.core.publisher.Flux;
  import reactor.core.publisher.Mono;
  
  @RestController
  public class ToDoController {
  
     private ToDoRespository repository;
  
     public ToDoController(ToDoRespository repository) {
      this.repository = repository;
     }
  
     @GetMapping("/rodo/{id}")
     public Mono&lt;ToDo&gt; getTodo(@PathVariable String id) {
        return this.repository.findById(id);
     }
  
     @GetMapping("/todo")
     public Flux&lt;ToDo&gt; getToDos() {
        return this.repository.findAll();
     }
  }
  </code></pre>
  
  <p>domain class</p>
  
  <pre><code> package com.thomsoncodes.todo.domain;
  
   import java.time.LocalDateTime;
   import java.util.UUID;
  
   import lombok.Data;
  
   @Data
   public class ToDo {
   private String id;
   private String description;
   private LocalDateTime created;
   private LocalDateTime modified;
   private boolean completed;
  
   public ToDo() {
      this.id = UUID.randomUUID().toString();
      this.created = LocalDateTime.now();
      this.modified = LocalDateTime.now();
   }
  
   public ToDo(String description) {
      this();
      this.description = description;     
   }
  
   public ToDo(String description, boolean completed) {
      this();
      this.description = description;
      this.completed = completed;
    }
  }
  </code></pre>
  
  <p>Repository class</p>
  
  <pre><code>package com.thomsoncodes.todo.repository;
  
  import java.util.Arrays; 
  import com.thomsoncodes.todo.domain.ToDo;
  import reactor.core.publisher.Flux;
  import reactor.core.publisher.Mono;
  
  public class ToDoRespository {
  
  private Flux&lt;ToDo&gt; toDoFlux = Flux.fromIterable(Arrays.asList(
          new ToDo("Do Homework"),
          new ToDo("Workout in the morning", true),
          new ToDo("Make dinner tonight"),
          new ToDo("Clean the studio", true),
          new ToDo("Learn spring boot", true)));
  
    public Mono&lt;ToDo&gt; findById(String id) {
      return Mono.from(
              toDoFlux.filter( todo -&gt; todo.getId().equals(id)));
    }
  
    public Flux&lt;ToDo&gt; findAll() {
       return toDoFlux;
    }
  
  
  }
  </code></pre>