title: nested exception class path resource SecurityAutoConfiguration.class cannot be opened because it does not exist
body: <p>I am stuck with this error for quite a while now. I am unable to proceed further. The error is as follows</p>
  <pre><code>Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.assessment.assescor.PersonControllerTest]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.class] cannot be opened because it does not exist
  
  </code></pre>
  <p>I am running a test for controller and the code is as follows</p>
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringBootTest(classes = PersonController.class)
  @AutoConfigureMockMvc
  @ContextConfiguration(classes = PersonCOnfig.class, loader = AnnotationConfigContextLoader.class)
  @ActiveProfiles(&quot;test&quot;)
  public class PersonControllerTest {
      private static final ObjectMapper om = new ObjectMapper();
  
      @Autowired
      private MockMvc mockMvc;
  
      @MockBean
      private PersonRepository personRepository;
  
      @Before
      public void init(){
          //ong id, String name, String lastName, String zipCode, String city, String color
          Person person = new Person(1, &quot;Raghu&quot;, &quot;Palakodety&quot;, &quot;45127&quot;, &quot;Essen&quot;, &quot;grün&quot;);
          when(personRepository.findById(1L)).thenReturn(Optional.of((person)));
      }
  
      @Test
      public void findPersonById() throws Exception {
          mockMvc.perform(get(&quot;/persons/1&quot;)).
                  andExpect((ResultMatcher) content().contentType(MediaType.APPLICATION_JSON)).
                  andExpect(status().isOk()).
                  andExpect((ResultMatcher) jsonPath(&quot;$id&quot;, is(1))).
                  andExpect((ResultMatcher) jsonPath(&quot;$name&quot;, is(&quot;Müller&quot;))).
                  andExpect((ResultMatcher) jsonPath(&quot;$lastName&quot;, is(&quot;Hans&quot;))).
                  andExpect((ResultMatcher) jsonPath(&quot;$zipCode&quot;, is(&quot;67742&quot;))).
                  andExpect((ResultMatcher) jsonPath(&quot;$city&quot;, is(&quot;Lauterecken&quot;))).
                  andExpect((ResultMatcher) jsonPath(&quot;$color&quot;, is(&quot;blau&quot;)));
  
          verify(personRepository, times(1)).findById(1L);
      }
  }
  </code></pre>
  <p>I am quite stuck with this problem, can anyone help me out. This is my first post, so please be easy on me.
  Thank you once again</p>