title: Spring boot test: Unable to instantiate inner configuration class
body: <p>I want to run <code>JUnit</code> tests for my <code>DAO</code> layer without involving my main Spring configurations. As such, I declared an inner class annotated with <code>@Configuration</code> so that it would override the configurations of the main application class annotated with <code>@SpringBootApplication</code>.</p>
  
  <p>This is the code:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @JdbcTest
  public class InterviewInformationControllerTest {
  
      @Configuration
      class TestConfiguration{
  
          @Bean
          public InterviewInformationDao getInterviewInformationDao(){
              return new InterviewInformationDaoImpl();
          }
      }
  
      @Autowired
      private InterviewInformationDao dao;
  
      @Test
      public void testCustomer() {
          List&lt;Customer&gt; customers = dao.getCustomers();
          assertNotNull(customers);
          assertTrue(customers.size() == 4);
  
      }
  
  }
  </code></pre>
  
  <p>But I'm getting the error:</p>
  
  <pre><code>Parameter 0 of constructor in com.test.home.controller.InterviewInformationControllerTest$TestConfiguration required a bean of type 'com.test.home.controller.InterviewInformationControllerTest' that could not be found.
  </code></pre>